In our application we make WSDL service call(let us say "SomeService"). We use JBoss 6.x and JDK1.8 in our environment(test). Our application also has dependency with CXF for some other services. "SomeService" should be called through standard JAXWS instead of "CXF". By default,c all is being routed through CXF and that's resulting into policy issues. Hence, I followed the solution mentioned below:
JAX-WS = When Apache CXF is installed it "steals" default JDK JAX-WS implementation, how to solve? .
I made the following change in my code:
if (previousDelegate.getClass().getName().contains("cxf")) {
ServiceDelegate serviceDelegate = ((Provider) Class.forName("com.sun.xml.internal.ws.spi.ProviderImpl").newInstance())
.createServiceDelegate(SomeService.WSDL_LOCATION, SomeService.SERVICE_NAME, service.getClass());
delegateField.set(service, serviceDelegate);
}
This change works fine for me in my local environment(I'm using Tomcat 8 +JDK 1.8). I went and deployed the code in test platform (it's JBoss 6.x + JDK 1.8). While testing the functionality, I'm getting the following error:
java.lang.ClassNotFoundException: com.sun.xml.internal.ws.spi.ProviderImpl from [Module "deployment.MyAPP.war:main" from Service Module Loader]
Not sure of the reason for this error. Anybody has clues about it? Do we need to make any additional changes in our JBoss server. Since "com.sun.xml.internal.ws.spi.ProviderImpl" is standard class and that's available in JDK1.8, I don't see any reason why am I getting the above error since our JBoss server is pointing to JDK1.8.
Your help is highly appreciated.