在java中创建非常简单的web服务时出现运行时建模器错误

在java中创建非常简单的web服务时出现运行时建模器错误,java,web-services,jax-ws,Java,Web Services,Jax Ws,我是java web服务的初学者 我创建了一个简单的web服务,在尝试发布它时,如下所示 Endpoint.publish("http://localhost:8080/HelloWeb", new HelloWeb()); 获取错误如下所示 Exception in thread "main" com.sun.xml.internal.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class com.rav

我是java web服务的初学者

我创建了一个简单的web服务,在尝试发布它时,如下所示

 Endpoint.publish("http://localhost:8080/HelloWeb", new HelloWeb());
获取错误如下所示

Exception in thread "main" com.sun.xml.internal.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class com.ravi.jaxws.SayGreeting 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:90)
at javax.xml.ws.Endpoint.publish(Endpoint.java:170)
at com.ravi.Server.main(Server.java:9)
知道这里出了什么问题吗

我的webservice类非常简单,下面是代码:

    @WebService
@SOAPBinding(style = Style.DOCUMENT, use=Use.LITERAL)
public class HelloWeb {

    @WebMethod
    public String sayHello(String name){
        return "Hello "+name;
    }
}

首先调用wsgen实用程序。此实用工具生成各种构件,即Endpoint.publish方法生成服务的WSDL所需的java类型 在工作目录中运行

  wsgen -keep -cp  package.HelloWeb

wsgen将从哪个目录运行?我正在使用EclipseJUNO,我正在尝试从类和src使用wsgen,但只是从wsgen工具获得如何使用它的帮助非常感谢。成功了。但是我在Windows环境中尝试了同样的方法,但是没有这个问题。您对此有什么想法吗?根据文档,无论底层平台是什么,它都应该能正常工作。理想情况下,您应该始终调用wsgen实用程序。我必须运行命令
wsgen-keep-cp。package.HelloWeb
位于target/classes/directory中。谢谢你的帮助。