小编Chr*_*ris的帖子

JAXB对根元素感到困惑?

我正在尝试使用Visio XML Schema编组文件,该模式由3个模式文件组成,并在使用XJC生成java源时生成三个包:

  • com.microsoft.schemas.visio._2003.core
  • com.microsoft.schemas.visio._2006.extension
  • com.microsoft.schemas.office.visio._2010.extension

根元素是VisioDocument,我正在使用的所有类都在2003包中.

这是我编组XML文件的方法:

VisioDocumentType visioDoc = new VisioDocumentType();
... manipulated here ...
JAXBContext jc = JAXBContext.newInstance("com.microsoft.schemas.visio._2003.core");
Marshaller m = jc.createMarshaller();
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
m.marshal(new JAXBElement<VisioDocumentType>(new QName("uri","local"), VisioDocumentType.class, visioDoc), bw);
Run Code Online (Sandbox Code Playgroud)

执行时,我收到此错误:

javax.xml.bind.MarshalException
 - with linked exception:
[com.sun.istack.internal.SAXException2: unable to marshal type "com.microsoft.schemas.visio._2003.core.PagePropsType" as an element because it is missing an @XmlRootElement annotation]
Run Code Online (Sandbox Code Playgroud)

我正在使用PagePropsType,但它不是根元素.为什么JAXB认为它是?

java visio jaxb

5
推荐指数
1
解决办法
1349
查看次数

安装失败,但增强的日志记录不包含错误

我有一个ClickOnce Office加载项,该加载项始终无法在PowerShell脚本中安装。该脚本正在从SCCM运行。当失败时,安装日志中唯一的错误是-400返回值,这当然几乎没有任何意义。在该错误之前和之后都有其他输出,并且没有任何异常。

在打开ClickOnce日志记录时,我能够复制一次,并且输出低于(没有时间戳记,因为我必须手动转录)。

安装失败:

PLATFORM VERSION INFO
  Windows             : 6.2.9200.0 (WinNT)
  Common Language Runtime     : 4.0.30319.42000
  System.Deployment.dll       : 4.7.2046.0 built by: NET47REL1
  clr.dll             : 4.7.3260.0 built by: NET472REL1LAST_C
  dfdll.dll           : 4.7.2046.0 built by: NET47REL1
  dfshim.dll          : 10.0.15063.0 (WinBuild.160101.0800)

SOURCES
  Deployment url         : file://path/to/my.vsto

ERROR SUMMARY
  No errors were detected during this operation.

COMPONENT STORE TRANSACTION FAILURE SUMMARY
  No transaction error was detected.

WARNINGS
  There were no warnings during this operation.

OPERATION PROGRESS STATUS
  No phase information is available.

ERROR DETAILS …
Run Code Online (Sandbox Code Playgroud)

clickonce vsto

5
推荐指数
0
解决办法
67
查看次数

标签 统计

clickonce ×1

java ×1

jaxb ×1

visio ×1

vsto ×1