简体   繁体   中英

Deploy was WS error jboss

I want to deploy a war with soap ws in java, but shows me the following error

Caused by: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "$Proxy182.setElementType(Ljavax/xml/namespace/QName;)V" the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the current class, $Proxy182, and the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) for interface javax/wsdl/extensions/ExtensibilityElement have different Class objects for the type javax/xml/namespace/QName used in the signature

my web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>WSLicenciaServ</display-name>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <display-name>WSLicenciaServ</display-name>
    <servlet-name>WSLicenciaServ</servlet-name>
    <servlet-class>app.algunDominio.webService.WSLicenciaServ</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>WSLicenciaServ</servlet-name>
    <url-pattern>/WSLicenciaServ</url-pattern>
  </servlet-mapping>

</web-app>

thank you very much

Are you sure you need all those libs? You have many jars that might be conflicting with jboss own jars, finding which one and at the same time keeping your app from not crashing won't be easy. You could instead try isolating your deployment classloader and make your app classes override the server classes. Place a file named jboss-web.xml in your WEB-INF directory with this content:

<?xml version="1.0" encoding="UTF-8"?> 
<jboss-web>
<class-loading java2ClassLoadingCompliance="false">
   <loader-repository>
      com.example:archive=unique-archive-name
      <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
   </loader-repository>
</class-loading>
</jboss-web>

com.example:archive=unique-archive-name is not really relevant as long as it's a unique name.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM