2016-11-04 69 views
0

当部署在Weblogic的12C一个JAX-WS web服务,我得到这个问题的Weblogic 12C(12.2.1)JAX WS和servlet问题

“weblogic.management.DeploymentException:HTTP:101401]的在Web应用程序例如URL模式 /PlatforrmTestService被映射到多个 Servlet的”

类:

@WebService(serviceName ="PlatforrmTestService", 
    wsdlLocation="WEB-INF/wsdl/pricing_V10/PlatforrmTestService.wsdl", 
    ) 
@WebServlet(urlPatterns = {"/PlatforrmTestService"}) 
public class TestService extends HttpServlet{ 
... 
} 

请帮助解决这个问题。

回答

0

如果您在@WebService中指定“serviceName”参数,则不应使用@WebServlet注释。

似乎WL12.2比早期版本

雷姆更加严格:我想你的web.xml没有servlet和servlet映射。

实际上,您不应该在WL12.2中使用@WebServlet注释@WebService注释。这是最简单的WS你可以WL12.2

import javax.jws.WebService; 

@WebService 
public class EchoTestWebService{ 
    public String echoTestWebMethod(String word) { 
     return word; 
    } 
} 

部署与类名是用于“服务名”和所有公共方法一个空的web.xml

<?xml version="1.0" encoding="UTF-8"?> 
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
     http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" 
     version="3.1"> 
</web-app> 

默认情况下是的WebMethod 。