使用相同的端点接口发布多个Jax-WS Web服务实现

时间:2014-05-27 10:58:04

标签: java web-services tomcat soap jax-ws

我必须提供多个web服务,每个服务都有不同的url,但是实现了相同的wsdl接口定义。我在Tomcat 8中使用JAX-WS和servlet上下文。

Tomcat无法启动上下文引发异常:

"GMBAL702: Exception in register"

<<的 实现 >>

WsFirstImpl.java

package org.testws;
 ...
@WebService(serviceName="MyWS",
        portName = "MyWSEndPoint",
        endpointInterface = "org.test.ws.impl.IMyWSEndPoint",
        targetNamespace = "http://impl.ws.application.org.test",
        wsdlLocation = "WEB-INF/wsdl/wsdef.wsdl")
public class WsFirstImpl {
 ...
}

WsSecondImpl.java

package org.testws;
 ...
@WebService(serviceName="MyWS",
        portName = "MyWSEndPoint",
        endpointInterface = "org.test.ws.impl.IMyWSEndPoint",
        targetNamespace = "http://impl.ws.application.org.test",
        wsdlLocation = "WEB-INF/wsdl/wsdef.wsdl")
public class WsSecondImpl {
 ...
}

<< JAX-WS配置 >>

太阳jaxws.xml

<?xml version="1.0" encoding="UTF-8"?>
<endpoints version="2.0" xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime">
    <endpoint implementation="org.testws.WsFirstImpl"
            name="impl1" url-pattern="/ws/firstws" />
<endpoint implementation="org.testws.WsSecondImpl"
            name="impl2" url-pattern="/ws/secondws" />
</endpoints>

我无法弄清楚

是什么错误

1 个答案:

答案 0 :(得分:0)

请使用以下系统属性设置再次运行:

或设置

-Dcom.sun.xml.ws.monitoring.registrationDebug = NORMAL