java.lang.LinkageError:接口itable初始化中的加载器约束冲突:解析方法时
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19856567/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method
提问by pise
I have developed a web service with authentication in java following the link Web Service AtuthenticationThe Same is runing fine if I am using JDK 1.6/JBoss 4.2 but when I deploy it in Jboss 5.1.0 GA I am getting deployment error. I google and found there is some jar conflict between JDK1.6,Jboss and my application. And replaced the JBoss/lib/endorsed jaxws-ri.jar with the latest jaxws-ri-2.2.8.jar. But I am not able to identify which jar is creating conflict now.
我已经开发了一个带有 Java 身份验证的 Web 服务,链接Web 服务认证如果我使用的是 JDK 1.6/JBoss 4.2,则运行正常,但是当我在 Jboss 5.1.0 GA 中部署它时,出现部署错误。我google了一下,发现JDK1.6,Jboss和我的应用程序之间存在一些jar冲突。并将 JBoss/lib/endorsed jaxws-ri.jar 替换为最新的 jaxws-ri-2.2.8.jar。但是我现在无法确定哪个 jar 正在产生冲突。
Below is my code of web.xml, sun-jaxws.xml and exception.
下面是我的 web.xml、sun-jaxws.xml 和异常代码。
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"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
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>biservices</display-name>
<listener>
<listener-class>
com.sun.xml.ws.transport.http.servlet.WSServletContextListener
</listener-class>
</listener>
<servlet>
<servlet-name>BiServices</servlet-name>
<servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>BiServices</servlet-name>
<url-pattern>/biservices</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>120</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
sun-jaxws.xml
<?xml version="1.0" encoding="UTF-8"?>
<endpoints xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime" version="2.0">
<endpoint
name="IBiUpdate"
implementation="com.sbilife.ws.BiUpdate"
url-pattern="/biservices"/>
</endpoints>
exception
java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "com.sun.xml.ws.util.xml.XMLStreamReaderFilter.getAttributeName(I)Ljavax/xml/namespace/QName;" the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the current class, com/sun/xml/ws/util/xml/XMLStreamReaderFilter, and the class loader (instance of <bootloader>) for interface javax/xml/stream/XMLStreamReader have different Class objects for the type javax/xml/namespace/QName used in the signature
Thanks Pise
谢谢皮斯
回答by taringamberini
The exception is thrown because in your web application at least exists a jar which contains the javax.xml.namespace.QName
class and that class conflicts with the same one contained in one of the JBoss's jar.
抛出异常是因为在您的 Web 应用程序中至少存在一个包含javax.xml.namespace.QName
该类的 jar,并且该类与 JBoss 的 jar 之一中包含的同一个冲突。
You should remove that (these) jar(s) from your web application when deploying on JBoss.
在 JBoss 上部署时,您应该从 Web 应用程序中删除(这些)jar。
A list of jars which contain the javax.xml.namespace.QName
class is at http://www.findjar.com/class/javax/xml/namespace/QName.html
包含javax.xml.namespace.QName
该类的 jar 列表位于http://www.findjar.com/class/javax/xml/namespace/QName.html