谁能帮我 ?在我的项目中,我需要解析一些架构文件,并且需要根据这些架构生成xml文件。现在,我想使用 MOXy 根据这些模式动态生成空的 xml 文件。但是发生了异常。
Internal Exception: com.sun.istack.SAXParseException2: "file:/F:/workspace/test/src/custom2.xsd" is not a part of this compilation. Is this a mistake for "file:/F:/workspace/test/src/custom.xsd"?
at org.eclipse.persistence.exceptions.JAXBException.errorCreatingDynamicJAXBContext(JAXBException.java:586)
at org.eclipse.persistence.jaxb.dynamic.metadata.SchemaMetadata$XJCErrorListener.error(SchemaMetadata.java:235)
at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.error(SchemaCompilerImpl.java:316)
at com.sun.tools.xjc.reader.internalizer.Internalizer.reportError(Internalizer.java:628)
at com.sun.tools.xjc.reader.internalizer.Internalizer.reportError(Internalizer.java:619)
at com.sun.tools.xjc.reader.internalizer.Internalizer.buildTargetNodeMap(Internalizer.java:262)
at com.sun.tools.xjc.reader.internalizer.Internalizer.buildTargetNodeMap(Internalizer.java:391)
at com.sun.tools.xjc.reader.internalizer.Internalizer.transform(Internalizer.java:146)
at com.sun.tools.xjc.reader.internalizer.Internalizer.transform(Internalizer.java:108)
at com.sun.tools.xjc.reader.internalizer.DOMForest.transform(DOMForest.java:442)
at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:230)
at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:94)
at org.eclipse.persistence.jaxb.dynamic.metadata.SchemaMetadata.getJavaModelInput(SchemaMetadata.java:138)
at org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext.initializeFromMetadata(DynamicJAXBContext.java:209)
at org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContextFactory.createContextFromXSD(DynamicJAXBContextFactory.java:345)
... 2 more
我认为原因是重新定义元素,因为当我使用导入或包含时,没关系。请帮我。无法将附件上传到stackoverflow?