JAX-WS and version conflicts

As a test project, I created a very simple WebService using wsdl and jax-ws. The client works very well if it is deployed as a web application in GlassFish, but if I run the same (WebService-) code in Eclipse directly, I get the following error:

WARNUNG: Input Action on WSDL operation AddNumbers and @Action on its associated Web Method addNumbers did not match and will cause problems in dispatching the requests Exception in thread "main" java.lang.NoClassDefFoundError: org/glassfish/ha/store/api/BackingStoreException at com.sun.xml.ws.rx.mc.runtime.McConfigurationFactory.createInstance(McConfigurationFactory.java:66) at com.sun.xml.ws.rx.mc.runtime.McTubeFactory.createTube(McTubeFactory.java:68) at com.sun.xml.ws.assembler.TubeCreator.createTube(TubeCreator.java:84) at com.sun.xml.ws.assembler.TubelineAssemblerFactoryImpl$MetroTubelineAssembler.createClient(TubelineAssemblerFactoryImpl.java:130) at com.sun.xml.ws.client.Stub.createPipeline(Stub.java:228) at com.sun.xml.ws.client.Stub.<init>(Stub.java:205) at com.sun.xml.ws.client.Stub.<init>(Stub.java:178) at com.sun.xml.ws.client.sei.SEIStub.<init>(SEIStub.java:85) at com.sun.xml.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:608) at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:348) at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:330) at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:312) at javax.xml.ws.Service.getPort(Service.java:134) at mnm.namedesdienstes.webservice.service.NameDesDienstesService.getNameDesDienstesPortTypePort(NameDesDienstesService.java:56) at webserviceClient.NameDesDienstesClient.myTest(NameDesDienstesClient.java:12) at webserviceClient.NameDesDienstesClient.main(NameDesDienstesClient.java:25) Caused by: java.lang.ClassNotFoundException: org.glassfish.ha.store.api.BackingStoreException at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) ... 16 more 

After some research, it turned out that this should have something to do with the different versions of some library files. So now my question is how can I “fix” java eclipse execution to start my webservice client correctly? I found some tips for copying some jar to a directory that was approved, but which banks to which directory :-)

I am using Max OS 10.6.8, Eclipse Project uses JVM 1.6. My Mac Java Version

 xmacbook:~ cstraube$ java -version java version "1.6.0_26" Java(TM) SE Runtime Environment (build 1.6.0_26-b03-384-10M3425) Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02-384, mixed mode) 

UPDATE My first attempt (thanks to the link from remipod). I have completed the following steps:

  • Get the catalog of approved lirbs using System.out.println(System.getProperty("java.endorsed.dirs"));
  • Then I copied the two files JAXWS2.1.7-20090419.jar and JAXB2_20080513.jar (both versions 2.1.7) into this directory
  • Sorry, I get the same error
+4
source share
4 answers

You need to copy the installation of the versions jaxws-api.jar and jaxb-api.jar to the / Library / Java / Home / lib / approved (Mac) directory.

+3
source

I have a similar problem with yours when deploying a web service (JAX-WS) to tomcat 7. An invalid class definition can be found in ha-api.jar.



org/glassfish/ha/store/api/BackingStoreException

You must add ha-api.jar (from the JAX-WS distribution) to the server library. For my case, eclipse runs tomcat 7, so the location (Tomcat 7.0 \ lib).

+10
source

Take a look at this JAX WS link with WS 2.1.1 . You will need to give preference to your jaxws version provided by jaxws from jre 1.6.

Edit: Glassfish already includes some libraries, as well as java 6. I had to track version conflicts with jaxws in Glassfish 3.1 / 3.1.1 and java 6/7. You can check the exact use of the eclipse of the Java environment to run the application and search for duplicate banks in the efficient class path.

The proven mechanism simply provides a simple and error-prone way to override the included jaxws distribution. A mistake because your colleague will suffer from the same problem.

I did not see the org.glassfish.ha.store.api.BackingStoreException exception in the jaxws context. Version conflict can be created by a different library than jaxws ...

+1
source

I experienced the same exception

org.glassfish.ha.store.api.BackingStoreException

And after my JAX-WS and JAX-B cans were the same version, the problem still arose.

FIX . Then I added the ha-api.jar directory to the WEB-INF \ lib directory, and this solved the problem.

The key here was the “ha” package in the path of the exception class, as shown above. Hope this helps!

+1
source

All Articles