通过Maven使用Apache Commons EmailValidator时,我遇到了以下不会部署我的应用程序的问题:
Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
java.lang.LinkageError: loader constraints violated when linking org/xml/sax/EntityResolver class
我在pom.xml上使用了以下代码:
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.3.1</version>
</dependency>
一个帮助?
答案 0 :(得分:0)
commons-validator-1.3.1.jar
工件提取xml-apis-1.0.b2.jar
,如下所示:
$ mvn dependency:tree [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'dependency'. [INFO] ------------------------------------------------------------------------ [INFO] Building Q2714398 [INFO] task-segment: [dependency:tree] [INFO] ------------------------------------------------------------------------ [INFO] [dependency:tree {execution: default-cli}] [INFO] com.stackoverflow:Q2714398:jar:1.0-SNAPSHOT [INFO] +- commons-validator:commons-validator:jar:1.3.1:compile [INFO] | +- commons-beanutils:commons-beanutils:jar:1.7.0:compile [INFO] | +- commons-digester:commons-digester:jar:1.6:compile [INFO] | | +- commons-collections:commons-collections:jar:2.1:compile [INFO] | | \- xml-apis:xml-apis:jar:1.0.b2:compile [INFO] | \- commons-logging:commons-logging:jar:1.0.4:compile [INFO] \- junit:junit:jar:3.8.1:test [INFO] ------------------------------------------------------------------------
LinkageError
建议你在JBoss上部署时在类路径上有xml-apis-1.0.b2.jar
的重复版本,这在这里是一个显而易见的嫌疑人。
可能只是尝试将其从已部署的应用程序中排除(无法使用当前的详细信息给出更准确的答案)。
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.3.1</version>
<exclusions>
<exclusion>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
</exclusion>
</exclusions>
</dependency>