今天在开发webservice 的时候遇到了一些问题,在这里记录下来。怕以后会忘记,哈哈。也希望可以帮助到遇到此问题的同学。
说说啥情况吧。这个项目是我入职这个公司之前就已经搭建好了的框架,功能没开发多少,jar包到是有一堆。我先把异常贴出来吧。
Exception in thread "main" com.sun.xml.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class com.aebell.webservice.jaxws.ReceiveMessage is n ot found. Have you run APT to
generate them?
at com.sun.xml.ws.model.RuntimeModeler.getClass(RuntimeModeler.java:287)
at com.sun.xml.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:596)
at com.sun.xml.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:543)
at com.sun.xml.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:371)
at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:258)
at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:322)
at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:188)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:467)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:486)
at com.sun.xml.ws.transport.http.server.EndpointImpl.createEndpoint(EndpointImpl.java:222)
at com.sun.xml.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:152)
at com.sun.xml.ws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:113)
at javax.xml.ws.Endpoint.publish(Unknown Source)
at com.aebell.webservice.ReceiveWebService.main(ReceiveWebService.java:49)
这个是问题,引起这个问题原因是:需要增加注释的这段代码。此代码的用处大家可以去查看API。
@WebService
//@SOAPBinding(style = SOAPBinding.Style.RPC)
public class ReceiveWebService {
好了,增加此代码解决了这个麻烦的问题。