import javax.jws.WebService;
import javax.xml.ws.Endpoint; /**
* Java6开发WebService入门
*
* @author leizhimin 2009-11-13 16:10:44
*/
@WebService
public class Java6WebService {
/**
* Web服务中的业务方法
*
* @return 一个字符串
*/
public String doSomething() {
return "Hello Java6 WebService!";
} public static void main(String[] args) {
//发布一个WebService
Endpoint.publish("http://localhost:8880/java6ws/lavasoft.Java6WebService", new Java6WebService());
}
}
我在eclipse运行这个代码,出现下面的错误,请问是什么原因Exception in thread "main" Server Runtime Error: class: com.ywh.jaxws.DoSomething could not be found
at com.sun.xml.internal.ws.transport.http.server.HttpEndpoint.publish(HttpEndpoint.java:269)
at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:87)
at com.sun.xml.internal.ws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:59)
at javax.xml.ws.Endpoint.publish(Endpoint.java:156)
at com.ywh.Java6WebService.main(Java6WebService.java:24)
Caused by: class: com.ywh.jaxws.DoSomething could not be found
at com.sun.xml.internal.ws.modeler.RuntimeModeler.getClass(RuntimeModeler.java:271)
at com.sun.xml.internal.ws.modeler.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:562)
at com.sun.xml.internal.ws.modeler.RuntimeModeler.processMethod(RuntimeModeler.java:509)
at com.sun.xml.internal.ws.modeler.RuntimeModeler.processClass(RuntimeModeler.java:355)
at com.sun.xml.internal.ws.modeler.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:251)
at com.sun.xml.internal.ws.server.RuntimeEndpointInfo.createSEIModel(RuntimeEndpointInfo.java:170)
at com.sun.xml.internal.ws.server.RuntimeEndpointInfo.init(RuntimeEndpointInfo.java:317)
at com.sun.xml.internal.ws.transport.http.server.HttpEndpoint.publish(HttpEndpoint.java:298)
at com.sun.xml.internal.ws.transport.http.server.HttpEndpoint.publish(HttpEndpoint.java:263)
... 4 more
import javax.xml.ws.Endpoint; /**
* Java6开发WebService入门
*
* @author leizhimin 2009-11-13 16:10:44
*/
@WebService
public class Java6WebService {
/**
* Web服务中的业务方法
*
* @return 一个字符串
*/
public String doSomething() {
return "Hello Java6 WebService!";
} public static void main(String[] args) {
//发布一个WebService
Endpoint.publish("http://localhost:8880/java6ws/lavasoft.Java6WebService", new Java6WebService());
}
}
我在eclipse运行这个代码,出现下面的错误,请问是什么原因Exception in thread "main" Server Runtime Error: class: com.ywh.jaxws.DoSomething could not be found
at com.sun.xml.internal.ws.transport.http.server.HttpEndpoint.publish(HttpEndpoint.java:269)
at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:87)
at com.sun.xml.internal.ws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:59)
at javax.xml.ws.Endpoint.publish(Endpoint.java:156)
at com.ywh.Java6WebService.main(Java6WebService.java:24)
Caused by: class: com.ywh.jaxws.DoSomething could not be found
at com.sun.xml.internal.ws.modeler.RuntimeModeler.getClass(RuntimeModeler.java:271)
at com.sun.xml.internal.ws.modeler.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:562)
at com.sun.xml.internal.ws.modeler.RuntimeModeler.processMethod(RuntimeModeler.java:509)
at com.sun.xml.internal.ws.modeler.RuntimeModeler.processClass(RuntimeModeler.java:355)
at com.sun.xml.internal.ws.modeler.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:251)
at com.sun.xml.internal.ws.server.RuntimeEndpointInfo.createSEIModel(RuntimeEndpointInfo.java:170)
at com.sun.xml.internal.ws.server.RuntimeEndpointInfo.init(RuntimeEndpointInfo.java:317)
at com.sun.xml.internal.ws.transport.http.server.HttpEndpoint.publish(HttpEndpoint.java:298)
at com.sun.xml.internal.ws.transport.http.server.HttpEndpoint.publish(HttpEndpoint.java:263)
... 4 more
解决方案 »
- 关于mysql乱码
- strtus2 拦截器 excludeMethods不起作用 设置该属性还是拦截其中方法
- 急求一个超级文本编辑器 (js代码)
- *************给小弟点建议************
- odbc连接数据库出了问题!急救!
- 帮忙推荐几本书!给50分!
- 中文处理小问题,马上给分!
- 请教各位高手,有关EJB的问题
- 大送分!!!!1000分大送分。谁帮我建一个网站送分1000!!大送分!!!!!校友录有人会做吗????1000分!!!!!1000分,!!!!!!!!!!!!!!!!!!!!
- 急:关于如何在jsp中调用数据库存储过程的问题
- 解决Myeclipes控制台信息输出问题
- 怎样获取struts1返回的页面的url
package com.ywh;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.ParameterStyle;
import javax.xml.ws.Endpoint;
@SOAPBinding(parameterStyle=ParameterStyle.BARE)
@WebService(serviceName="Java6WebService" ,targetNamespace="http://ywh.com")
public class Java6WebService {
@WebMethod
@WebResult(name="doSomethingResponse")
public String doSomething(@WebParam(name="input")String input){
return "hello:"+input;
};
public static void main(String[] args){
Endpoint.publish("http://localhost:8887/GeoGlobeServer", new Java6WebService());
}; }