Java.lang.LinkageError: boot loader restriction previously triggered by loading for another type named "javax / xml / soap / SOAPMessage"

I am new to web services. I am trying to call a service, but I have an error below. Based on my initial Google search, this seems to be a bootloader issue that might be caused by duplicate banks, but I can't find which one is causing this. Any help is greatly appreciated.

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) 
+4
source share
2 answers

What I decided to solve was a duplicate of saaj.jar in my projects.

+1
source

LinkageError - this is JBoss, usually caused by the fact that your application packs its own copies of certain libraries that JBoss considers limited. Usually these are things in java packages. * And javax. *.

Try adding cxf-rt-frontend-jaxws and cxf-bundle-rs as dependencies and note some exceptions -> jetty-server, gernomino-servlet.

Also check that beans.xml should be under the classpath, not WEB-INF.

0
source

Source: https://habr.com/ru/post/1486654/


All Articles