Apache Commons EmailValidator 和 SeamListener 异常(未部署)

发布于 2024-08-30 16:09:07 字数 556 浏览 6 评论 0原文

通过 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>

有帮助吗?

When using Apache Commons EmailValidator through Maven, I have the following problem that doesn't deploy my app:

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

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

乖乖 2024-09-06 16:09:07

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>

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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文