java Weblogic 14c webservicedescriptionname在weblogicwebservices中不是唯一的
我使用以下注释将无状态ejb公开为web服务:
@WebService(
name = "MyServicePort",
portName = "MyServicePort",
serviceName = "MyService",
)
@SOAPBinding(
style = SOAPBinding.Style.RPC
)
@Stateless(mappedName="MyServiceEJB", name = "MyServiceEJB")
public class MyServiceBean {
为了在weblogic中定义上下文根,我在weblogic webservices中定义了web服务。xml部署描述符如下所示:
<weblogic-webservices
xmlns="http://xmlns.oracle.com/weblogic/weblogic-webservices"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-webservices http://xmlns.oracle.com/weblogic/weblogic-webservices/1.1/weblogic-webservices.xsd">
<webservice-description>
<webservice-description-name>MyService</webservice-description-name>
<port-component>
<port-component-name>MyServicePort</port-component-name>
<service-endpoint-address>
<webservice-contextpath>/mycontext</webservice-contextpath>
<webservice-serviceuri>/myservice</webservice-serviceuri>
</service-endpoint-address>
</port-component>
</webservice-description>
</weblogic-webservices>
然而,weblogic在部署时抛出以下错误:
[ERROR] weblogic.wsee.ws.WsException: Error encountered while deploying WebService module 'myservice-ejb.jar'.
In weblogic-webservices.xml, webservice-description-name MyService is not unique within weblogic-webservices
知道我做错了什么吗?这是我的web应用程序中唯一的bean/服务,在weblogic(本地实例)中没有部署其他应用程序
# 1 楼答案
我可以通过将包含以下内容的
webservices.xml
放入META-INF
文件夹(weblogic webservices.xml旁边)来解决这个问题希望它能帮助面临同样挑战的人