About Jax-WS Unable to create Jaxbcontext error

Source: Internet
Author: User

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
  1. 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 Code

    Encountered the error itself will not be Google down, did not find what I want, and Baidu, Online said add

Java code
    1. @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
  1. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.