在jax-ws

时间:2018-12-22 20:24:26

标签: jax-ws

我是Jax-ws的新手,并在我的示例示例中尝试处理模型错误。我在以下代码中添加了代码,并在tomcat启动时添加了代码,但出现了以下异常。谁能帮我吗?

@WebService(endpointInterface="com.ps.services.PersonServices")

公共类PersonServicesImpl实现PersonServices {

private static Map<Integer, Person> persons = new HashMap<>();

@Override
public boolean addPerson(Person p) throws AvailaleId {

    if ((persons.get(p.getId())) != null) {
            throw new AvailaleId(p.getId());
    }
    persons.put(p.getId(), p);
    return true;
}

}

公共类AvailaleId扩展了RuntimeException {

public AvailaleId(int id) {
    super("The person with id "+id+"is not available" );
}

}

例外:

严重:WSSERVLET11:未能解析运行时描述符:类:找不到com.ps.services.jaxws.AvailaleIdBean 类:找不到com.ps.services.jaxws.AvailaleIdBean     在com.sun.xml.ws.modeler.RuntimeModeler.getClass(RuntimeModeler.java:269)     在com.sun.xml.ws.modeler.RuntimeModeler.processExceptions(RuntimeModeler.java:958)     在com.sun.xml.ws.modeler.RuntimeModeler.processRpcMethod(RuntimeModeler.java:936)     在com.sun.xml.ws.modeler.RuntimeModeler.processMethod(RuntimeModeler.java:508)     在com.sun.xml.ws.modeler.RuntimeModeler.processClass(RuntimeModeler.java:353)     在com.sun.xml.ws.modeler.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:249)     在com.sun.xml.ws.server.RuntimeEndpointInfo.createModel(RuntimeEndpointInfo.java:180)     在com.sun.xml.ws.server.RuntimeEndpointInfo.init(RuntimeEndpointInfo.java:326)     在com.sun.xml.ws.transport.http.servlet.WSServletContextListener.createModelAndMetadata(WSServletContextListener.java:203)     在com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:119)     在org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4792)     在org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256)     在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1421)     在org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1411)     在java.util.concurrent.FutureTask.run(未知来源)     在java.util.concurrent.ThreadPoolExecutor.runWorker(未知来源)     在java.util.concurrent.ThreadPoolExecutor $ Worker.run(未知来源)     在java.lang.Thread.run(未知来源)

0 个答案:

没有答案