我是webservices的新手。我正在尝试拨打服务,但我遇到了以下错误。根据我最初的谷歌搜索似乎这是一个加载器问题,可能是由重复的罐子引起的,但我找不到哪一个导致这个问题。非常感谢任何帮助。
Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) previously initiated loading for a different type with name "javax/xml/soap/SOAPMessage"
at org.apache.cxf.jaxws.support.JaxWsEndpointImpl.<init>(JaxWsEndpointImpl.java:126)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.createEndpoint(JaxWsServiceFactoryBean.java:208)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.createEndpoints(ReflectionServiceFactoryBean.java:366)
at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:297)
at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:178)
at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:100)
at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:51)
at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:102)
at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:115)
at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:437)
at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:316)
at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:303)
at javax.xml.ws.Service.getPort(Service.java:92)
答案 0 :(得分:1)
解决了我的问题是我的项目中重复的saaj.jar。
答案 1 :(得分:0)
LinkageError是JBoss,通常是由你的应用程序打包JBoss认为限制的某些库的副本。这些通常是java。*和javax。*包中的东西。
尝试添加cxf-rt-frontend-jaxws和cxf-bundle-rs作为依赖项并标记一些排除项 - &gt; jetty-server,gernomino-servlet。
同时检查beans.xml是否应该在classpath下,而不是WEB-INF。