javax jws deploy无法获取端点

时间:2014-03-18 18:39:38

标签: java web-services openshift

我写了一个简单的java web服务(使用javax jws)。我试图在openshift中将此服务部署到Jboss服务器。当我尝试访问该服务时,我收到上述异常。

Java服务接口:

@PermitAll
@WebService
@SOAPBinding(style = Style.RPC)
public interface CalWebService {
    @WebMethod int add(int x, int y);
}

Java服务实现:

@PermitAll
@WebService(
endpointInterface="cmps.CalWebService",
portName="CalWebServicePort",
serviceName="CalWebService")
public class CalWebServiceImp implements CalWebService {
    @Override
    public int add(int a, int b) {
        return a + b;
    }
}

例外:http://cmps-mohamadjaber.rhcloud.com/CalWebService

HTTP状态500 -

输入例外报告

消息

description服务器遇到内部错误(),导致无法完成此请求。

例外

javax.servlet.ServletException:Servlet cmps.CalWebServiceImp的Servlet.init()抛出异常     org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)     org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)     org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)     org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)     org.apache.coyote.http11.Http11Protocol $ Http11ConnectionHandler.process(Http11Protocol.java:671)     org.apache.tomcat.util.net.JIoEndpoint $ Worker.run(JIoEndpoint.java:930)     java.lang.Thread.run(Thread.java:744) 根本原因

javax.xml.ws.WebServiceException:无法获取以下端点:jboss.ws:context =,endpoint = cmps.CalWebServiceImp     org.jboss.wsf.stack.cxf.transport.ServletHelper.initServiceEndpoint(ServletHelper.java:108)     org.jboss.wsf.stack.cxf.transport.ServletHelper.initEndpoint(ServletHelper.java:82)     org.jboss.wsf.stack.cxf.CXFServletExt.loadBus(CXFServletExt.java:64)     org.jboss.wsf.stack.cxf.CXFServletExt.init(CXFServletExt.java:58)     org.jboss.wsf.spi.deployment.WSFServlet.init(WSFServlet.java:57)     org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)     org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)     org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)     org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)     org.apache.coyote.http11.Http11Protocol $ Http11ConnectionHandler.process(Http11Protocol.java:671)     org.apache.tomcat.util.net.JIoEndpoint $ Worker.run(JIoEndpoint.java:930)     java.lang.Thread.run(Thread.java:744) 注意JBoss Web / 7.0.13.Final日志中提供了根本原因的完整堆栈跟踪。

JBoss Web / 7.0.13.Final

1 个答案:

答案 0 :(得分:1)

您需要在jboss-web.xml下创建WEB-INF文件 用:

<?xml version="1.0" encoding="UTF-8"?>
    <jboss-web>
        <context-root>/</context-root>
    </jboss-web>

如下所述: openshift - how to obtain webservice endpoint