如果我使用 JDK 1.6/JBoss 4.2,我已经在 Java中开发了一个带有身份验证的Web 服务 ,如果我使用的是 JDK 1.6/JBoss 4.2,那么它运行良好,但是当我在 Jboss 5.1.0 GA 中部署它时,我遇到了部署错误。我谷歌发现JDK1.6,Jboss和我的应用程序之间存在一些jar冲突。并将 JBoss/lib/endorsed jaxws-ri.jar 替换为最新的 jaxws-ri-2.2.8.jar。但我现在无法确定哪个 jar 正在造成冲突。
下面是我的 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
谢谢猪油