Java链接错误JAX-WS

时间:2011-04-06 07:43:01

标签: java jboss jax-ws jdk1.6

我在尝试使用WebServices时遇到此错误。我搜索它并发现它发生,因为可能存在相同类文件的不同版本或发生一些冲突。我在运行Web应用程序时尝试给出了一个支持目录路径,但仍然没有运气。我使用的环境是JDK 1.6.0.20和JBoss 5.0。:

java.lang.LinkageError: loader constraint violation: when resolving method "javax.xml.ws.Service.<init>(Ljava/net/URL;Ljavax/xml/namespace/QName;)V" the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the current class, com/abc/amservice/AMService, and the class loader (instance of <bootloader>) for resolved class, javax/xml/ws/Service, have different Class objects for the type javax/xml/namespace/QName used in the signature
    com.abc.amservice.AMService.<init>(AMService.java:48)
    com.abcx.accessmanager.plugin.provider.webservice.ServiceConnection.createAndInitializeNewService(ServiceConnection.java:103)
    com.abcx.accessmanager.plugin.provider.webservice.ServiceConnection.getAMService(ServiceConnection.java:91)
    com.abcx.accessmanager.plugin.provider.webservice.ServiceConnection.createNewServicePort(ServiceConnection.java:136)
    com.abcx.accessmanager.plugin.provider.webservice.ServiceConnection.getWebServicePort(ServiceConnection.java:69)
    com.abcx.accessmanager.plugin.provider.webservice.AuthenticationProviderWebService.getWebServicePort(AuthenticationProviderWebService.java:536)
    com.abcx.accessmanager.plugin.provider.webservice.AuthenticationProviderWebService.authenticateUser(AuthenticationProviderWebService.java:80)
    com.abcx.accessmanager.plugin.provider.validator.ValidatingAuthenticationProvider.authenticateUser(ValidatingAuthenticationProvider.java:59)
    com.abcx.accessmanager.plugin.api.AccessManagementServiceConnector.authenticateUser(AccessManagementServiceConnector.java:61)
    com.qwe.spring.security.MyAuthenticationProvider.additionalAuthenticationChecks(MyAuthenticationProvider.java:33)
    org.springframework.security.providers.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:137)
    org.springframework.security.providers.ProviderManager.doAuthentication(ProviderManager.java:188)
    org.springframework.security.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:46)
    org.springframework.security.ui.webapp.AuthenticationProcessingFilter.attemptAuthentication(AuthenticationProcessingFilter.java:82)
    org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:259)
    org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89)
    org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
    org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175)
    org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
    org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

非常感谢任何帮助。感谢

2 个答案:

答案 0 :(得分:2)

可以在this question中找到解决方案。

简而言之:确保您不部署另一个javax.xml.namespace.*包,依赖于Java 6附带的包

答案 1 :(得分:0)

有两种选择可以帮助您:

1 - 在运行时更改Jboss版本。再次下载Jboss,你的版本可以被破解,这很常见。因此,根据您的安装在Eclipse中设置Jboss运行时如:&#34; C:\ jboss-eap-5.1 \ jboss-as&#34;。

OR

2 - 刚刚在构建路径中删除了lib wsdl4j.jar,如果你的情况可行的话。