Myeclipse使用JAX开发Web Service客户端遇到版本问题

通过MyEclipse 6.5 开发基于JAX的东东。


//这是生成client时的警告,不过好像指没有验证,对之后的使用没有发现问题。
WS-I: A problem occurred while running the WS-I WSDL conformance check:
org.eclipse.wst.wsi.internal.analyzer.
WSIAnalyzerException.
The WS-I Test Assertion Document(TAD) was either not found or could not be processed.
The WSDLAnalyzer was unable to validate the given WSDL file.

-
如果使用web项目(包括web service)时生成客户端使回到问题。
这是在web项目下做client测试时发生的exception,在java application中没有问题
Exception in thread "main" java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/C:/Program%20Files/MyEclipse%206.5/myeclipse/eclipse/plugins/com.genuitec.eclipse.ws.xfire_6.5.1.zmyeclipse650200806/lib/webservices-rt.jar!/com/sun/xml/bind/v2/model/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.<clinit>(ModelBuilder.java:173)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:422)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:286)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:210)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:368)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:220)
at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:218)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.ws.spi.ProviderImpl.getEPRJaxbContext(ProviderImpl.java:217)
at com.sun.xml.ws.spi.ProviderImpl.<clinit>(ProviderImpl.java:88)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:36)
at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:95)
at javax.xml.ws.spi.Provider.provider(Provider.java:76)
at javax.xml.ws.Service.<init>(Service.java:57)
at cn.edu.scau.ws.SayHelloService.<init>(SayHelloService.java:54)
at Test.main(Test.java:8)

解决方法:是jar包jaxb的版本冲突了。删掉MyEclipse中为你添加的javaEE的包。
希望大家原谅本人水平有限,希望能跟大家一起进步~~

你可能感兴趣的:(java,xml,Web,MyEclipse,sun)