javaclassloaderesbjboss-esb

Some class(StubExt) is not visible from class loader, JbossESB


I have got fallowing error when i call my service:

2015-07-06 14:53:09,885 ERROR [org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl] (pool-39-thread-1) Cannot create proxy for SEI com.foo.FooPortType from: jar:file:/D:/servers/jboss-soa-p-5/jboss-as/server/default/deploy/Foo.esb!/
2015-07-06 14:53:09,887 ERROR javax.xml.ws.WebServiceException: Cannot create proxy
at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.createProxy(ServiceDelegateImpl.java:471)
at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.getPortInternal(ServiceDelegateImpl.java:304)
at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.getPort(ServiceDelegateImpl.java:225)
at javax.xml.ws.Service.getPort(Service.java:92)
at com.foo.FooService.getFooPort(FooService.java:86)
at com.foo.actions.FooAction.process(FooAction.java:65)
at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:649)
at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:603)
at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:433)
at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:550)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)

Caused by: java.lang.IllegalArgumentException: interface org.jboss.ws.core.StubExt is not visible from class loader
at java.lang.reflect.Proxy.getProxyClass0(Proxy.java:461)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:690)
at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.createProxy(ServiceDelegateImpl.java:451)
... 12 more

This service is calling another one. I have added maven dependency:

    <dependency>
        <groupId>org.jboss.ws.native</groupId>
        <artifactId>jbossws-native-core</artifactId>
        <version>4.2.1.Final</version>
    </dependency>

And if i will open this jar, i clearly can see StubExt class.

What can be wrong?

This problem is similar to: https://developer.jboss.org/thread/232142

However there is no answer at all :(


Solution

  • Stupid mistake... I had 2 copies of jbossws-native-core.

    One in .esb file, second one in lib folder on my Jboss server.

    Adding a <scope>provided</scope> to jbossws-native-core dependency solved my problem.