【问题标题】:Getting error while deploying two same web applications with different context in jboss EAP 7.2在 jboss EAP 7.2 中部署两个具有不同上下文的相同 Web 应用程序时出错
【发布时间】:2020-05-27 05:03:20
【问题描述】:

我正在尝试在 jboss EAP 7.2 上部署具有不同上下文的相同 Web 应用程序 像 testOne.war 和 testTwo.war。我的网址会像

1)http://127.0.0.1:8080/testOne/get。 2)http://127.0.0.1:8080/testTwo/get.

两个战争都正确部署,但只有一个 url 工作正常,另一个通过覆盖默认服务器引发错误。

[org.wildfly.extension.undertow] (ServerService Thread Pool -- 84) WFLYUT0021: Registered web context: '/testOne' for server 'default-server'

它被

压倒了
[org.wildfly.extension.undertow] (ServerService Thread Pool -- 84) WFLYUT0021: Registered web context: '/testTwo' for server 'default-server'

在上述情景http://127.0.0.1:8080/testTwo/get。可以正常工作,http://127.0.0.1:8080/testOne/get 会抛出异常

UT005023: Exception handling request to testOne/get: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.glassfish.jersey.message.internal.InboundMessageContext.getHeaders()Ljavax/ws/rs/core/MultivaluedMap;" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, org/glassfish/jersey/server/ContainerRequest, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for interface javax/ws/rs/container/ContainerRequestContext have different Class objects for the type javax/ws/rs/core/MultivaluedMap used in the signature

在 tomcat 8.5.35 中同样可以正常工作

【问题讨论】:

  • 您如何部署您的应用程序?我的猜测是您应该使用 jboss-cli 中的 deploy 命令并指定运行时名称
  • 我已经复制到 jboss-eap-7.2/standalone/deployments 并运行 ./standalone.sh 。通过文件系统部署
  • 我也尝试使用 jboss-cli 进行部署,但没有成功
  • 您是否指定了运行时名称?你的战争中有 jboss-web.xml 吗?
  • 是的,在 jboss-deplyment-structure.xml 中。我已经排除了<exclude-subsystems> <subsystem name="jaxrs" /> <subsystem name="jpa" /> </exclude-subsystems> <exclusions> <module name="javaee.api" /> <module name="org.jboss.as.jaxrs" /> <module name="org.jboss.as.jpa" /> </exclusions>

标签: java jboss jboss7.x jboss-eap-7


【解决方案1】:

在“jboss-deployment-structure.xml”的sn-p下面添加

<?xml version="1.0" encoding="UTF-8"?>
  <jboss-deployment-structure>
    <deployment>
      <dependencies>
        <module name="org.jboss.remote-naming" />
      </dependencies>
    </deployment>
  </jboss-deployment-structure>

【讨论】:

  • 这似乎是 Wildfly 类加载机制的问题。 Jboss EAP 6.3.3 及以上版本支持 JDK 8。
猜你喜欢
  • 2020-03-09
  • 2014-09-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-09-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多