webservice发布报错:javax.xml.ws.WebServiceException: Unable to create JAXBContext [main]
2017-05-15 17:34
555 查看
在写webservice接口的时候,服务端用的JAX-WS发布服务。但是发布的时候报错:
javax.xml.ws.WebServiceException: Unable to create JAXBContext [main] c.icitic.web.TicketWebServiceServlet
网上说是返回值问题,返回值应该只支持基本的String、int,但我所有方法的返回值都是String。又查了一下,原来是我新加的方法,webservice接口实现类里面我新加了一个返回值是void的set方法,注释掉该方法后就能够正常发布了。
总结,webservice接口实现类中一切客户端不会调用的方法前面都应该加上标签:
@WebMethod(exclude = true)
该标签表名这个方法不作为webservice的方法发布。
javax.xml.ws.WebServiceException: Unable to create JAXBContext [main] c.icitic.web.TicketWebServiceServlet
网上说是返回值问题,返回值应该只支持基本的String、int,但我所有方法的返回值都是String。又查了一下,原来是我新加的方法,webservice接口实现类里面我新加了一个返回值是void的set方法,注释掉该方法后就能够正常发布了。
总结,webservice接口实现类中一切客户端不会调用的方法前面都应该加上标签:
@WebMethod(exclude = true)
该标签表名这个方法不作为webservice的方法发布。
相关文章推荐
- webservice发布报错:javax.xml.ws.WebServiceException: Unable to create JAXBContext
- 在调用别人的webservice时候,需要生成客户端调用。调用时出现javax.xml.ws.WebServiceException: Unable to create JAXBContext 这个问
- Caused by: javax.xml.ws.WebServiceException: Unable to create JAXBContext 错误提示
- javax.xml.ws.WebServiceException: WSDL Metadata not available to create the proxy, either Service in
- java使用JAX-WS来写webservice时 Unable to create JAXBContext
- Java使用JAX-WS来写webservice时 Unable to create JAXBContext
- Exception in thread "main" javax.xml.ws.WebServiceException: Could not find wsdl:binding operation i
- 关于Exception in thread "main" javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.Servic
- Exception in thread "main" javax.xml.ws.WebServiceException: Could not find wsdl:binding operation i
- javax.xml.ws.WebServiceException: java.net.SocketTimeoutException: Read timed out
- javax.xml.ws.WebServiceException: Provider com.sun.xml.ws.spi.ProviderImpl not found
- javax.xml.ws.webserviceexception class do not have a property of the name
- EJB项目启动报"javax.xml.ws.WebServiceException:Cannot find service endpoint target:"
- JAX-WS 报错 Unable to create JAXBContext
- 异常:javax.xml.ws.WebServiceException: Could not find wsdl:binding operation info for web method sayHi
- javax.xml.ws.WebServiceException: No Content-type in the header!
- javax.xml.bind.JAXBException: Unable to locate jaxb.properties for package
- javax.xml.bind.JAXBException: JAXBContextImpl nor any of its super class is known to this context
- CXF 客户端异常 javax.xml.ws.soap.SOAPFaultException: Cannot create a secure XMLInputFactory
- WebService学习笔记系列之三----通过javax.xml.ws.Service的方式调用WebService