【发布时间】:2015-11-22 13:37:20
【问题描述】:
我在解组类时收到此错误。我正在使用 Amazon 的 mTurks 以及 Spring、Maven 和(惊讶、惊讶)一个 xerces 问题已经引起了它的注意。
我以多种不同的方式使用 POM 来尝试解决问题,但我似乎无法找到解决方案。
我正在使用此处找到的 mturks 的 mavenized 版本: https://github.com/tc/java-aws-mturk
我已经明确地从 mturks 中排除了 xerces 的东西:
<dependency>
<groupId>com.amazon</groupId>
<artifactId>java-aws-mturk</artifactId>
<version>1.2.2</version>
<exclusions>
<exclusion>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</exclusion>
<exclusion>
<groupId>apache-xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
<exclusion>
<groupId>apache-xerces</groupId>
<artifactId>resolver</artifactId>
</exclusion>
<exclusion>
<groupId>apache-xerces</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
</exclusions>
</dependency>
并明确包含 xerces-impl 和 xml-api 依赖项:
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
</dependency>
我已经尝试了 xercesImpl 版本 2.9.1、2.11.0 和 xml-apis 版本 1.4.01、2.0.2 的所有四种组合,但无济于事。
xercesImpl 2.11.0 和 xml-api 2.0.2 导致不同的错误:
java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
我该如何解决这个问题?
【问题讨论】:
标签: java xml spring maven xerces