com.sun.xml.internal.ws.model.RuntimeModelerException:
2017-03-18 20:40
513 查看
原网址:
http://chenbingyyent.blog.163.com/blog/static/135278835201102484716262/
一个WebService示例
import javax.jws.WebService;
import javax.xml.ws.Endpoint;
@WebService //标志这个类是一个webservice
public class HelloService {
//
public String SayHello(String name){
System.out.println("Hello " + name);
return " Hello "+name;
}
public static void main(String[] args) {
/**
* 调用静态方法endpoint.publish
* 1)address 访问地址
* 2)implementor 实现者
*
*/
//服务地址
String address="http://localhost:9080/hello";
Endpoint.publish(address, new HelloService());
System.out.println("HelloService ready():" );
}
}
报错:
Exception in thread "main" com.sun.xml.internal.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class com.fengzhengshu.test.jaxws.SayHello is not found. Have you run APT to generate them?
at com.sun.xml.internal.ws.model.RuntimeModeler.getClass(RuntimeModeler.java:256)
at com.sun.xml.internal.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:567)
at com.sun.xml.internal.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:514)
at com.sun.xml.internal.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:341)
at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:227)
at com.sun.xml.internal.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:308)
at com.sun.xml.internal.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:174)
at com.sun.xml.internal.ws.api.server.WSEndpoint.create(WSEndpoint.java:420)
at com.sun.xml.internal.ws.api.server.WSEndpoint.create(WSEndpoint.java:439)
at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.createEndpoint(EndpointImpl.java:208)
at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:138)
at com.sun.xml.internal.ws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:92)
at javax.xml.ws.Endpoint.publish(Endpoint.java:170)
at com.fengzhengshu.test.HelloService.main(HelloService.java:29)
解决方法:
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
import javax.xml.ws.Endpoint;
@WebService //标志这个类是一个webservice
@SOAPBinding(style = Style.RPC) //添加这一行
http://chenbingyyent.blog.163.com/blog/static/135278835201102484716262/
一个WebService示例
import javax.jws.WebService;
import javax.xml.ws.Endpoint;
@WebService //标志这个类是一个webservice
public class HelloService {
//
public String SayHello(String name){
System.out.println("Hello " + name);
return " Hello "+name;
}
public static void main(String[] args) {
/**
* 调用静态方法endpoint.publish
* 1)address 访问地址
* 2)implementor 实现者
*
*/
//服务地址
String address="http://localhost:9080/hello";
Endpoint.publish(address, new HelloService());
System.out.println("HelloService ready():" );
}
}
报错:
Exception in thread "main" com.sun.xml.internal.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class com.fengzhengshu.test.jaxws.SayHello is not found. Have you run APT to generate them?
at com.sun.xml.internal.ws.model.RuntimeModeler.getClass(RuntimeModeler.java:256)
at com.sun.xml.internal.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:567)
at com.sun.xml.internal.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:514)
at com.sun.xml.internal.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:341)
at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:227)
at com.sun.xml.internal.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:308)
at com.sun.xml.internal.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:174)
at com.sun.xml.internal.ws.api.server.WSEndpoint.create(WSEndpoint.java:420)
at com.sun.xml.internal.ws.api.server.WSEndpoint.create(WSEndpoint.java:439)
at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.createEndpoint(EndpointImpl.java:208)
at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:138)
at com.sun.xml.internal.ws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:92)
at javax.xml.ws.Endpoint.publish(Endpoint.java:170)
at com.fengzhengshu.test.HelloService.main(HelloService.java:29)
解决方法:
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
import javax.xml.ws.Endpoint;
@WebService //标志这个类是一个webservice
@SOAPBinding(style = Style.RPC) //添加这一行
相关文章推荐
- Exception in thread "main" com.sun.xml.internal.ws.model.RuntimeModelerException:
- com.sun.xml.internal.ws.model.RuntimeModelerException错误
- com.sun.xml.internal.ws.model.RuntimeModelerException: class:com.mark.cxf.service could not be found
- Exception in thread "main" com.sun.xml.internal.ws.model.RuntimeModelerException: 必须在没有程序包的类上指定 @Web
- [webservice]com.sun.xml.internal.ws.model.RuntimeModelerException: runtime modeler error:
- Exception in thread "main" com.sun.xml.internal.ws.model.RuntimeModelerException: 解决办法
- com.sun.xml.internal.ws.model.RuntimeModelerException错误
- com.sun.xml.internal.ws.model.RuntimeModelerException: runtime modeler error:
- com.sun.xml.internal.ws.model.RuntimeModelerException: runtime modeler error:
- Exception in thread "main" com.sun.xml.internal.ws.model.RuntimeModelerException
- com.sun.xml.internal.ws.model.RuntimeModelerException: runtime modeler error:
- BUG:com.sun.xml.internal.ws.model.RuntimeModelerException: runtime modeler error
- com.sun.xml.internal.ws.server.ServerRtException: Server Runtime Error: java.net.BindException: Cannot assign requested address: bind
- 解决com.sun.xml.internal.ws.streaming.XMLStreamReaderException: unexpected XML tag.
- com.sun.xml.internal.ws.server.sei.EndpointMethodHandler invoke java.lang.IllegalArgumentException
- Exception in thread "main" com.sun.xml.internal.ws.client.ClientTransportException: HTTP transport e
- Exception in thread "main" com.sun.xml.internal.ws.streaming.XMLStreamReaderException: unexpected XML tag.
- cxf和spring整合出现的问题: com.sun.xml.internal.ws.fault.ServerSOAPFaultException: Client received SOAP Faul
- 解决com.sun.xml.internal.ws.streaming.XMLStreamReaderException: unexpected XML tag.
- webservice:com.sun.xml.internal.ws.server.ServerRtException: [failed to localize]