【发布时间】:2016-07-18 16:55:17
【问题描述】:
我正在尝试使用以下注释在 Weblogic 12c 中部署 Web 服务:
@SchemaValidation
@BindingType(javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING)
@WebService(serviceName = "xxxxx",
targetNamespace = "http://bla/BusinessServices/yyy/xxxxx/V1",
wsdlLocation = "META-INF/wsdl/zzz/yyy/xxxxx/V1/xxxxxConcrete.wsdl",
portName = "xxxxxPort",
endpointInterface = "ble.businessservices.yyy.xxxxx.v1.xxxxx")
//@Transactional(value= Transactional.TransactionFlowType.SUPPORTS, version= Transactional.Version.WSAT12)
@Stateless
@SecurityPolicies(@SecurityPolicy(uri = "my_policy"))
@DeclareRoles("my-role")
@Interceptors({InterceptorClass1.class, InterceptorClass2.class, InterceptorClass3.class})
public class xxxxxV1 extends HttpServlet implements xxxxx {...}
我正在使用 web.xml 来定义 servlet 别名,并使用 weblogic.xml 文件来定义我想要使用的上下文根。
问题是,如果我留下@Stateless 注解,部署时会出现以下异常:
Target state: deploy failed on Server services_server
javax.naming.NameAlreadyBoundException: my-webservice-name-impl-1.0.0.0-SNAPSHOT.war#MyWebServiceName is already bound; remaining name 'app/wsee'
at weblogic.deploy.api.tools.deployer.Jsr88Operation.report(Jsr88Operation.java:547)
at weblogic.deploy.api.tools.deployer.Deployer.perform(Deployer.java:140)
at weblogic.deploy.api.tools.deployer.Deployer.runBody(Deployer.java:88)
at weblogic.utils.compiler.Tool.run(Tool.java:158)
at weblogic.utils.compiler.Tool.run(Tool.java:115)
at weblogic.Deployer.run(Deployer.java:74)
... 15 more
另一方面,如果我删除 web.xml,我可以毫无错误地进行部署,但是我的 web 服务的 URL 当然不是我想要定义的:它使用 /portName/serviceName URL .
而且,如果我删除@Stateless 注解,我会得到所需的 URL,但 拦截器被忽略,这在逻辑上是不可接受的。
我尝试过使用 @Transactional 注释(参见上面的注释代码),但拦截器一直被忽略。
有人知道我缺少什么吗?理想情况下,我会使用 web.xml 和 @Transactional 并进入拦截器。
谢谢大家!
【问题讨论】:
标签: web-services weblogic web-deployment weblogic12c stateless