JAX-WS和版本冲突 [英] JAX-WS and version conflicts
问题描述
WARNUNG:在WSDL操作上输入操作AddNumbers和@Action在其关联的Web方法addNumbers不匹配,并且将在调度请求时导致问题
线程mainjava.lang中的异常com.uncn.ws.rx.mc.runtime.McConfigurationFactory.createInstance(McConfigurationFactory.java:66)
在com上的.NoClassDefFoundError:org / glassfish / ha / store / api / BackingStoreException
sun.xml.ws.rx.mc.runtime.McTubeFactory.createTube(McTubeFactory.java:68)
在com.sun.xml.ws.assembler.TubeCreator.createTube(TubeCreator.java:84)
在com.sun.xml.ws.assembler.TubelineAssemblerFactoryImpl $ MetroTubelineAssembler.createClient(TubelineAssemblerFactoryImpl.java:130)
在com.sun.xml.ws.client.Stub.createPipeline(Stub.java:228)
在com.sun.xml.ws.client。 Stub。< init>(stub.java:205)
在com.sun.xml.ws.client.Stub。< init>(Stub.java:178)
在com.sun。 xml.ws.client.sei.SEIStub。< init>(SEIStub.java:85)
在com.sun.xml.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:608)
在com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:348)
在com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:330)
在com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:312)
在javax.xml.ws.Service.getPort(Service.java:134)
在mnm.namedesdienstes .webservice.service.NameDesDienstesService.getNameDesDienstesPortTypePort(NameDesDienstesService.java:56)
在webserviceClient.NameDesDienstesClient.myTest(NameDesDienstesClient.java:12)
在webserviceClient.NameDesDienstesClient.main(NameDesDienstesClient.java:25)
导致:java.lang.ClassNotFoundException:org.glassfish.ha.store.api.Backi在java.net.URLClassLoader $ 1.run(URLClassLoader.java:202)上的$ s
$ java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass( URLClassLoader.java:190)
在java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher $ AppClassLoader.loadClass(Launcher.java:301)
在java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 16更多
经过一番研究,我发现它必须与某些库文件的不同版本有关。所以现在我的问题是,我如何修复我的eclipse java执行正确运行我的webservice客户端?我发现一些提示,将一些jar复制到一个已批准的目录,但哪个jar到哪个目录: - )
我使用的是最大的操作系统10.6.8, Eclipse Project使用JVM 1.6。我的Mac Java版本是
xmacbook:〜cstraube $ java -version
java版本1.6.0_26
Java(TM)SE运行时环境(构建1.6.0_26-b03-384-10M3425)
Java HotSpot(TM)64位服务器虚拟机(构建20.1-b02-384,混合模式)
更新:我第一次尝试(感谢remipod的链接)我执行了以下步骤:
- 使用
System.out.println(System.getProperty(java.endorsed)获取已认可的lirbaries目录.dll));
- 接下来,我将两个文件JAXWS2.1.7-20090419.jar和JAXB2_20080513.jar(版本2.1.7)复制到这个目录
- 不幸的是我仍然有同样的错误
您必须复制适合的版本的jaxws-api.jar和jaxb-api.jar进入目录/ Library / Java / Home / lib / approved(Mac) 。
As test project I've create a very simple WebService using wsdl and jax-ws. The client runs very well if it is deployed as web application in GlassFish but if I start 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 I found out that it must have something to do with different versions of some library files. So now my question is, how can I "fix" my eclipse java execution to run my webservice client correctly? I've found some tips to copy some jar to an endorsed-directory, but which jars into which directory :-)
I'm using Max OS 10.6.8, Eclipse Project uses JVM 1.6. My Mac Java Version is
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 try (thanks to the link from remipod) I performed the following steps:
- Get the directory of endorsed lirbaries with
System.out.println(System.getProperty("java.endorsed.dirs"));
- Next, I copied the two files JAXWS2.1.7-20090419.jar and JAXB2_20080513.jar (both Version 2.1.7) into this directory
- Unfortunately I get still the same error
You have to copy the fitting versions of jaxws-api.jar and jaxb-api.jar into the directory /Library/Java/Home/lib/endorsed (Mac).
这篇关于JAX-WS和版本冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!