- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在从 XSD 模式生成源代码的过程中,我得到一个 SAXParseException(见下文)。架构“gws-ctsa-myapp.xsd”正在导入两个基本组件“gws-services-types.xsd”和“gws-ctsa.xsd”。最后一个也导入相同的基本组件“gws-services-types.xsd”,这两个基本组件都是通过类路径目录解析器找到的。
我希望基本组件“gws-ctsa.xsd”中的导入对于架构“gws-ctsa-myapp.xsd”是不可见的,但不幸的是,情况并非如此。
当我在项目“project_root/myapp/myapp-jaxb”上运行“mvn compile”时,它工作正常。当我在项目根目录“project_root/”上运行它时,它不起作用。项目目录如下所示:
...
project_root/
project_root/common/
project_root/common/common-jaxb
...
project_root/myapp/
project_root/myapp/myapp-jaxb
...
这是异常堆栈跟踪:
[INFO] Started execution.
[INFO] JAXB API is loaded from the [jar:file:/C:/Program%20Files/Java/jdk1.6.0_22/jre/lib/rt.jar!].
[INFO] Detected JAXB API version [2.1].
[INFO] pluginArtifacts:[org.jvnet.jaxb2.maven2:maven-jaxb2-plugin-raw:jar:0.7.3:runtime, org.codehaus.plexus:plexus-utils:jar:1.1:runtime, ...
[INFO] schemaLanguage:null
[INFO] schemaDirectory:D:\eclipse\pbona\workspace\tobias-ROOT\myapp\myapp-jaxb\src\main\resources
[INFO] schemaIncludes:[Ljava.lang.String;@883540
[INFO] schemaExcludes:null
[INFO] bindingDirectory:D:\eclipse\pbona\workspace\tobias-ROOT\myapp\myapp-jaxb\src\main\xjc
[INFO] bindingIncludes:[Ljava.lang.String;@603c9f
[INFO] bindingExcludes:null
[INFO] disableDefaultExcludes:false
[INFO] catalog:D:\eclipse\pbona\workspace\tobias-ROOT\myapp\myapp-jaxb\src\main\xjc\catalog.cat
[INFO] catalogResolver:org.jvnet.jaxb2.maven2.resolver.tools.ClasspathCatalogResolver
[INFO] generatePackage:com.company.myapp.xjcctsamyapp
[INFO] generateDirectory:D:\eclipse\pbona\workspace\tobias-ROOT\myapp\myapp-jaxb\target\generated-sources\xjc
[INFO] readOnly:false
[INFO] extension:false
[INFO] strict:true
[INFO] writeCode:true
[INFO] verbose:true
[INFO] debug:false
[INFO] args:[-npa]
[INFO] forceRegenerate:true
[INFO] removeOldOutput:false
[INFO] otherDepends:null
[INFO] episodeFile:D:\eclipse\pbona\workspace\tobias-ROOT\myapp\myapp-jaxb\target\generated-sources\xjc\META-INF\sun-jaxb.episode
[INFO] episode:true
[INFO] classpathElements:[D:\eclipse\pbona\workspace\tobias-ROOT\myapp\myapp-jaxb\target\classes]
[INFO] plugins:[Lorg.apache.maven.model.Dependency;@2c14f9
[INFO] episodes:null
[INFO] xjcPlugins:[Lorg.apache.maven.model.Dependency;@2c14f9
[INFO] episodes:null
[INFO] specVersion:2.1
[INFO] schemaFiles (calculated):[D:\eclipse\pbona\workspace\tobias-ROOT\myapp\myapp-jaxb\src\main\resources\gws-ctsa-myapp.xsd]
[INFO] bindingFiles (calculated):[D:\eclipse\pbona\workspace\tobias-ROOT\myapp\myapp-jaxb\src\main\xjc\binding.xjb]
[INFO] xjcPluginArtifacts (resolved):[active project artifact:
artifact = com.company.common:common-jaxb:jar:1.0-SNAPSHOT:runtime;
project: MavenProject: com.company.common:common-jaxb:1.0-SNAPSHOT @ D:\eclipse\pbona\workspace\tobias-ROOT\common\common-jaxb\pom.xml]
[INFO] xjcPluginFiles (resolved):[D:\eclipse\pbona\workspace\tobias-ROOT\common\common-jaxb\target\classes]
[INFO] xjcPluginURLs (resolved):[file:/D:/eclipse/pbona/workspace/tobias-ROOT/common/common-jaxb/target/classes/]
[INFO] episodeArtifacts (resolved):[]
[INFO] episodeFiles (resolved):[]
[INFO] The schemaLanguage setting was not defined, assuming 'AUTODETECT'.
Using java.util.ServiceLoader
[INFO] Parsing input schema(s)...
[ERROR] Error while parsing schema(s).Location [ file:/D:/eclipse/pbona/workspace/tobias-ROOT/common/common-jaxb/target/classes/gws-service-types.xsd{14,35}].
org.xml.sax.SAXParseException: 'requiredString' is already defined
at com.sun.xml.xsom.impl.parser.ParserContext$1.reportError(ParserContext.java:176)
at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.reportError(NGCCRuntimeEx.java:170)
at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.reportError(NGCCRuntimeEx.java:173)
at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.checkDoubleDefError(NGCCRuntimeEx.java:145)
at com.sun.xml.xsom.impl.parser.state.Schema.action6(Schema.java:92)
at com.sun.xml.xsom.impl.parser.state.Schema.onChildCompleted(Schema.java:1176)
at com.sun.xml.xsom.impl.parser.state.NGCCHandler.revertToParentFromEnterElement(NGCCHandler.java:110)
at com.sun.xml.xsom.impl.parser.state.simpleType.enterElement(simpleType.java:130)
at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.startElement(NGCCRuntime.java:219)
at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:527)
at com.sun.tools.xjc.util.SubtreeCutter.startElement(SubtreeCutter.java:104)
at com.sun.tools.xjc.reader.ExtensionBindingChecker.startElement(ExtensionBindingChecker.java:144)
at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:527)
at com.sun.tools.xjc.reader.xmlschema.parser.IncorrectNamespaceURIChecker.startElement(IncorrectNamespaceURIChecker.java:113)
at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:527)
at com.sun.tools.xjc.reader.xmlschema.parser.CustomizationContextChecker.startElement(CustomizationContextChecker.java:188)
at org.xml.sax.helpers.XMLFilterImpl.startElement(XMLFilterImpl.java:527)
at com.sun.tools.xjc.reader.internalizer.DOMForestScanner$LocationResolver.startElement(DOMForestScanner.java:141)
at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:239)
at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:276)
at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:245)
at com.sun.xml.bind.unmarshaller.DOMScanner.scan(DOMScanner.java:122)
at com.sun.tools.xjc.reader.internalizer.DOMForestScanner.scan(DOMForestScanner.java:89)
at com.sun.tools.xjc.reader.internalizer.DOMForestScanner.scan(DOMForestScanner.java:97)
at com.sun.tools.xjc.reader.internalizer.DOMForestParser.parse(DOMForestParser.java:99)
at com.sun.tools.xjc.ModelLoader$XMLSchemaParser.parse(ModelLoader.java:262)
at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.parseEntity(NGCCRuntimeEx.java:337)
at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.importSchema(NGCCRuntimeEx.java:243)
at com.sun.xml.xsom.impl.parser.state.importDecl.action0(importDecl.java:45)
at com.sun.xml.xsom.impl.parser.state.importDecl.leaveElement(importDecl.java:138)
at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.endElement(NGCCRuntime.java:275)
at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
at com.sun.tools.xjc.util.SubtreeCutter.endElement(SubtreeCutter.java:108)
at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
at com.sun.tools.xjc.reader.xmlschema.parser.CustomizationContextChecker.endElement(CustomizationContextChecker.java:194)
at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
at com.sun.tools.xjc.reader.internalizer.DOMForestScanner$LocationResolver.endElement(DOMForestScanner.java:135)
at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:250)
at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:276)
at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:245)
at com.sun.xml.bind.unmarshaller.DOMScanner.scan(DOMScanner.java:122)
at com.sun.tools.xjc.reader.internalizer.DOMForestScanner.scan(DOMForestScanner.java:89)
at com.sun.tools.xjc.reader.internalizer.DOMForestScanner.scan(DOMForestScanner.java:97)
at com.sun.tools.xjc.reader.internalizer.DOMForestParser.parse(DOMForestParser.java:99)
at com.sun.tools.xjc.ModelLoader$XMLSchemaParser.parse(ModelLoader.java:262)
at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.parseEntity(NGCCRuntimeEx.java:337)
at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.importSchema(NGCCRuntimeEx.java:243)
at com.sun.xml.xsom.impl.parser.state.importDecl.action0(importDecl.java:45)
at com.sun.xml.xsom.impl.parser.state.importDecl.leaveElement(importDecl.java:138)
at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.endElement(NGCCRuntime.java:275)
at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
at com.sun.tools.xjc.util.SubtreeCutter.endElement(SubtreeCutter.java:108)
at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
at com.sun.tools.xjc.reader.xmlschema.parser.CustomizationContextChecker.endElement(CustomizationContextChecker.java:194)
at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
at com.sun.tools.xjc.reader.internalizer.DOMForestScanner$LocationResolver.endElement(DOMForestScanner.java:135)
at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:250)
at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:276)
at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:245)
at com.sun.xml.bind.unmarshaller.DOMScanner.scan(DOMScanner.java:122)
at com.sun.tools.xjc.reader.internalizer.DOMForestScanner.scan(DOMForestScanner.java:89)
at com.sun.tools.xjc.reader.internalizer.DOMForestScanner.scan(DOMForestScanner.java:97)
at com.sun.tools.xjc.reader.internalizer.DOMForestParser.parse(DOMForestParser.java:99)
at com.sun.tools.xjc.ModelLoader$XMLSchemaParser.parse(ModelLoader.java:262)
at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.parseEntity(NGCCRuntimeEx.java:337)
at com.sun.xml.xsom.impl.parser.ParserContext.parse(ParserContext.java:124)
at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:183)
at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:172)
at com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:516)
at com.sun.tools.xjc.ModelLoader.loadXMLSchema(ModelLoader.java:375)
at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:167)
at com.sun.tools.xjc.ModelLoader.load(ModelLoader.java:113)
at org.jvnet.jaxb2.maven2.RawXJC2Mojo.loadModel(RawXJC2Mojo.java:637)
at org.jvnet.jaxb2.maven2.RawXJC2Mojo.doExecute(RawXJC2Mojo.java:259)
at org.jvnet.jaxb2.maven2.RawXJC2Mojo.execute(RawXJC2Mojo.java:135)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
...
我在 project_root/common/common-jaxb/pom.xml 中使用命令“mvn compile”和以下插件配置:
<build>
<!-- *******************************************************************
* Plugins
******************************************************************* -->
<plugins>
<!-- Generieren -->
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<executions>
...
<!-- CTSA_MYAPP-->
<execution>
<id>gws-ctsa-myapp</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<schemaIncludes>
<include>gws-ctsa-myapp.xsd</include>
</schemaIncludes>
<generatePackage>com.company.myapp.xjcctsamyapp</generatePackage>
</configuration>
</execution>
</executions>
<!-- wir muessen dem Plugin noch sagen, wo die gws-service-types.xsd u.a. herkommt -->
<configuration>
<plugins>
<plugin>
<groupId>com.company.common</groupId>
<artifactId>common-jaxb</artifactId>
</plugin>
</plugins>
<catalogResolver>org.jvnet.jaxb2.maven2.resolver.tools.ClasspathCatalogResolver</catalogResolver>
<catalog>${xjc.resources.dir}/catalog.cat</catalog>
</configuration>
</plugin>
</plugins>
</build>
我尝试了很多更改和不同的配置,例如目录中的绝对路径(避免目录解析器)、不同的命名空间和架构位置,但没有解决问题。有人知道吗?
非常感谢!
佩德罗。
最佳答案
我认为问题出在目录解析器的使用上。我不认为这是 maven 插件中的错误,这一定是 JAXB-XJC 中的问题。我想请您准备一个重现此行为的演示/示例项目(越小越好)并将其归档在 JIRA 中。 .我将在下一个版本中解决这个问题。
关于java - SAX 解析异常 : maven jaxb2 plugin seems not to import schemas correctly,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6507321/
尝试熟悉 Maven 并参加在线类(class),但陷入困境......感谢提供的任何帮助。 我正在运行站点阶段,虽然它已完成并且我能够在浏览器中实际查看index.html,但我在此过程中遇到了很多
基本上就是标题。。我在任何地方都找不到一个简单的比较,来解释这两者之间的差异:。我知道Gradle中可以有3种类型的插件:。我认为这三种类型的插件在某种程度上与它们可以在settings.gradle
我是 maven 的初学者,现在我对这些 maven 插件之间的区别感到困惑。这些都是创建jar文件吗?现在我的问题是 各个插件创建的jar有什么区别。(组装插件、jar-plugin、shaded插
我使用 tycho-packaging-plugin 来设置 jar 的输出文件夹。这是我的 pom 的缩短版本: 0.21.0 org.eclipse.
When starting the server, refuses to load my plugin with an error:启动服务器时,拒绝加载我的插件,并出现错误: Could n
为什么卸载以下(空)插件会导致错误? 这是my-plugin/my-plugin.php : : my-plugin 关于wordpress - 由于错误 : Could not fully remo
我使用 sbt 与 playframework 和 activator 来构建一个 Web 应用程序。我的 sbt 版本是 0.13.0 我将plugin.sbt 文件更改为: logLevel :=
这是我运行 atlas-create-jira-plugin 时得到的结果后跟 atlas-create-jira-plugin-module选择选项1: Component Import . 问题是
我正在尝试使用 Maven 构建我的 Java 项目,但它失败了,并且出现以下错误: 从存储库 [local (C:\Users\Vinita.Gupta.m2\repository), centra
我正在使用 eclipse mars-2。我想在 Windows 中创建一个新的 Maven Spring Boot 项目。但我遇到了类似 的错误 Could not calculate build
最近开发的产品,我们是有四五个maven模块,开发阶段一直是在eclipse中运行的,然后快发版的时候,需要把这些项目打成jar包,通过命令去启动,那首先就得把这些模块项目打包,或者拷贝一些资源文件等
我想使用 maven-resources-plugin 复制 Excel 并使用 exec-maven-plugin 从该 Excel 创建一些属性文件。并且新创建的属性需要附加到构建中。我可以创建属
当我尝试构建项目时出现此错误。 Errors occurred during the build. Errors running builder 'Maven Project Builder' on
当我在执行 Maven 时从 eclipse 内部 -> 更新项目我遇到以下问题 Unable to update Maven configuration Could not calculate bu
我之前问过一个关于延迟处理事件的问题:Grails non time based queuing .我开始使用 rabbitmq 插件:http://grails.org/plugin/rabbitm
我正在尝试使用 maven 构建一个 java spring 项目(来自 heroku 入门指南的默认项目)。出于某种原因,我不断收到以下错误。机器上网应该没有问题。 Failed to execut
操作系统:OSX 10.11 Cordova :5.4.1(也尝试过 6.0)节点:4.2.6使用的cordova插件:crosswalk-project/cordova-plugin-crosswa
org.sonatype.maven.plugin :emma-maven-plugin:1.2 org.codehaus.mojo :emma-maven-plugin:1.0-alpha-3 or
我正在管理安装了很多插件的多个 shopware 6 商店。后端只允许更新一个插件,这非常耗时,因为更新分两步完成: 更新已加载(加载器圈) 后端已重新加载(html 重新加载) 为什么没有“更新所有
我正在管理安装了很多插件的多个 shopware 6 商店。后端只允许更新一个插件,这非常耗时,因为更新分两步完成: 更新已加载(加载器圈) 后端已重新加载(html 重新加载) 为什么没有“更新所有
我是一名优秀的程序员,十分优秀!