Apache Commons EmailValidator and SeamListener Exception (not deploying)
When using Apache Commons EmailValidator through Maven, I have the following problem that doesn't deploy my app:
Exception sen开发者_运维技巧ding 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
I've used the following code at my pom.xml:
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.3.1</version>
</dependency>
One help?
The commons-validator-1.3.1.jar
artifact pulls xml-apis-1.0.b2.jar
as shown below:
$ 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] ------------------------------------------------------------------------
The LinkageError
suggests that you have duplicate versions of xml-apis-1.0.b2.jar
, which is an obvious suspect here, on the classpath when deploying on JBoss.
Maybe simply try to exclude it from the deployed application (can't give a more precise answer with the current level of details).
<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>
精彩评论