Reference: http://53873039oycg.iteye.com/blog/1979421
Today, I learned a simple example of Jax-WS, and encountered the following error when I first started publishing:
Java code
class Com.test.service.jaxws.add is not found. Do you run the APT to generate them? soapbinding
I looked up the information on the internet and said it was to designate
Java code
Reason:
1 soapbinding Style default is SOAPBinding.Style.DOCUMENT, to be modified to RPC 2 Jdk1.6 version Low, a new high version of the
The type of the binding is then specified on the interface
Java code
@SOAPBinding (style = SOAPBinding.Style.RPC)
At noon, thinking about every time to write such a line, trouble, the computer on the jdk1.6.0.10 replaced with jdk1.6.0.32.
In the afternoon try to return to the list<user> type, previously used CXF, remember CXF Jax-ws return list<javabean> This type is not required to configure, the results just released on the error message as follows:
Java code
Exception in thread "main"javax.xml.ws.WebServiceException:Unable to create Jaxbcontext at Com.sun.xml.internal.ws.model.AbstractSEIModel Impl.createjaxbcontext (Abstractseimodelimpl.java:153) at Com.sun.xml.internal.ws.model.AbstractSEIModelImpl.postProcess (Abstractseimodelimpl.java:83) at Com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel (Runtimemodeler.java:244) at Com.sun.xml.internal.ws.server.EndpointFactory.createSEIModel (Endpointfactory.java:312) at Com.sun.xml.internal.ws.server.EndpointFactory.createEndpoint (Endpointfactory.java:178) at Com.sun.xml.internal.ws.api.server.WSEndpoint.create (Wsendpoint.java:456) at Com.sun.xml.internal.ws.api.server.WSEndpoint.create (Wsendpoint.java:475) at Com.sun.xml.internal.ws.transport.http.server.EndpointImpl.createEndpoint (Endpointimpl.java:213) at Com.sun.xml.internal.ws.transport.http.server.EndpointImpl.publish (Endpointimpl.java:143) at Com.sun.xml.internal.ws.spi.ProviderImpl.createAndPublishEndpoint (Providerimpl.java:102) at Javax.xml.ws.Endpoint.publish (Endpoint.java:170) at Com.huse.ws.basic.chap.server.test.MyServer.main (Myserver.java:13) caused by:java.security.PrivilegedActionException: Com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException:2counts of Illegalannotationexceptions Java.util.List is anInterface, and JAXB can ' t handle interfaces. Thisproblem is related to the following location:at java.util.List Java.util.List does not having a no-argdefaultconstructor. Thisproblem is related to the following Location:at java.util.List at Java.security.AccessController.doP Rivileged (Native Method) at Com.sun.xml.internal.ws.model.AbstractSEIModelImpl.createJAXBContext ( Abstractseimodelimpl.java:140) ... One more
View CodeEncountered the error itself will not be Google down, did not find what I want, and Baidu, Online said add
Java code
@SOAPBinding (style = SOAPBinding.Style.RPC)
OK, RPC I have, on the implementation of the class added @webmethod, a release or error, in another Baidu several times without fruit, a chance I took
Java code
@SOAPBinding (style = SOAPBinding.Style.RPC)
This line was deleted and released again, with the following results:
Java code
2013-11-22 14:38:08Com.sun.xml.internal.ws.model.RuntimeModeler Getrequestwrapperclass Info: Dynamically creating request Wrapper Class Com.huse.ws.basic.chap.server.inter.jaxws.Plus2013-11-22 14:38:08Com.sun.xml.internal.ws.model.RuntimeModeler Getresponsewrapperclass Info: Dynamically creating response wrapper Bean Class Com.huse.ws.basic.chap.server.inter.jaxws.PlusResponse2013-11-22 14:38:08Com.sun.xml.internal.ws.model.RuntimeModeler Getrequestwrapperclass Info: Dynamically creating request Wrapper Class Com.huse.ws.basic.chap.server.inter.jaxws.Minus2013-11-22 14:38:08Com.sun.xml.internal.ws.model.RuntimeModeler Getresponsewrapperclass Info: Dynamically creating response wrapper Bean Class Com.huse.ws.basic.chap.server.inter.jaxws.MinusResponse2013-11-22 14:38:08Com.sun.xml.internal.ws.model.RuntimeModeler Getrequestwrapperclass Info: Dynamically creating request Wrapper Class Com.huse.ws.basic.chap.server.inter.jaxws.AddUser2013-11-22 14:38:08Com.sun.xml.internal.ws.model.RuntimeModeler Getresponsewrapperclass Info: Dynamically creating response wrapper Bean Class Com.huse.ws.basic.chap.server.inter.jaxws.AddUserResponse2013-11-22 14:38:08Com.sun.xml.internal.ws.model.RuntimeModeler Getrequestwrapperclass Info: Dynamically creating request Wrapper Class Com.huse.ws.basic.chap.server.inter.jaxws.GetUser2013-11-22 14:38:08Com.sun.xml.internal.ws.model.RuntimeModeler Getresponsewrapperclass Info: Dynamically creating response wrapper Bean Class Com.huse.ws.basic.chap.server.inter.jaxws.GetUserResponse2013-11-22 14:38:08Com.sun.xml.internal.ws.model.RuntimeModeler Getrequestwrapperclass Info: Dynamically creating request Wrapper Class Com.huse.ws.basic.chap.server.inter.jaxws.ListUser2013-11-22 14:38:08Com.sun.xml.internal.ws.model.RuntimeModeler Getresponsewrapperclass Info: Dynamically creating response wrapper Bean Class Com.huse.ws.basic.chap.server.inter.jaxws.ListUserResponse2013-11-22 14:38:08Com.sun.xml.internal.ws.model.RuntimeModeler Getrequestwrapperclass Info: Dynamically creating request Wrapper Class Com.huse.ws.basic.chap.server.inter.jaxws.Login2013-11-22 14:38:08Com.sun.xml.internal.ws.model.RuntimeModeler Getresponsewrapperclass Info: Dynamically creating response wrapper Bean Class Com.huse.ws.basic.chap.server.inter.jaxws.LoginResponse2013-11-22 14:38:08Com.sun.xml.internal.ws.model.RuntimeModeler Getexceptionbeanclass Info: Dynamically creating exception bean Class Com.huse.ws.basic.chap.server.inter.jaxws.UserExceptionBean
It's OK.
Again, this JDK version is jdk.1.6.0.32, Jdk1.6.0.10 above I have not tested.
About Jax-WS Unable to create Jaxbcontext error