首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在WebLogic11g上设置EJB3 set服务的连接路径

在WebLogic11g上设置EJB3 set服务的连接路径
EN

Stack Overflow用户
提问于 2013-12-01 00:08:26
回答 1查看 2.8K关注 0票数 0

我用ejb3和maven ( Eclipse )、代码优先( JAXWS )、没有WSDL和(没有WAR )、只有ejb和Eclipse构建了一个web服务,该服务在JBOSS中工作,但现在我需要将该服务放在WebLogic11g中。

有了JBOSS,我就有了注释

代码语言:javascript
复制
@WebContext(contextRoot="/wsManCa7", urlPattern="/manCA7WS")

但是在Weblogic上,我发现了http://erikwramner.wordpress.com/2012/03/26/ejb3-web-service-context-path-in-weblogic-11g/创建weblogic-webservices.xml和webservices.xml的链接,我把文件放在jar的META中( JAr在EAR中),但是web逻辑引发了这个错误。

代码语言:javascript
复制
 Servlet: "WSEE_SERVLET" failed to preload on startup in Web application: 
 "/ManCA7". com.sun.xml.ws.server.ServerRtException: Port namespace
 http://someserver.com/ManCA7 doesnt match Service namespace {1} at
 com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:160) at
 com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:496) at
 com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:539) at
 weblogic.wsee.jaxws.JAXWSDeployedServlet.getEndpoint(JAXWSDeployedServlet.java:183) at
 weblogic.wsee.jaxws.JAXWSServlet.registerEndpoint(JAXWSServlet.java:138) at
 weblogic.wsee.jaxws.JAXWSServlet.init(JAXWSServlet.java:67) at ....

我知道问题是这个标签

代码语言:javascript
复制
<wsdl-port xmlns:ws="http://someserver.com/ManCA7">ws:ManCA7Port</wsdl-port>

,但哪个是所需的服务名称空间?

我不知道标签里放了什么

我的webservices.xml是

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
  <webservices xmlns="http://java.sun.com/xml/ns/javaee"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2">
   <webservice-description>
      <webservice-description-name>ManCA7</webservice-description-name>
        <port-component>
            <port-component-name>ManCA7Port</port-component-name>
            <wsdl-port xmlns:ws="http://someserver.com/ManCA7">ws:ManCA7Port</wsdl-port>
            <service-endpoint-interface>my.company.manCA7.sei.ManCa7SEI</service-endpoint-interface>
               <service-impl-bean>
                    <ejb-link>ManCa7EndPoint</ejb-link>
              </service-impl-bean>
         </port-component>
       </webservice-description>
    </webservices>

我的weblogic-webservices.xml是

代码语言:javascript
复制
  <?xml version = '1.0' encoding = 'UTF-8'?>
  <weblogic-webservices xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.bea.com/ns/weblogic/weblogic-webservices
   http://www.bea.com/ns/weblogic/weblogic-webservices/1.0/weblogic-webservices.xsd"
   xmlns="http://www.bea.com/ns/weblogic/weblogic-webservices">
   <webservice-description>
        <webservice-description-name>ManCA7</webservice-description-name>
        <webservice-type>JAXWS</webservice-type>
        <port-component>
          <port-component-name>ManCA7Port</port-component-name>
        <service-endpoint-address>
           <webservice-contextpath>/ManCA7</webservice-contextpath>
           <webservice-serviceuri>/Mant</webservice-serviceuri>
        </service-endpoint-address>
     <wsdl>
         <exposed>true</exposed>
     </wsdl>
     </port-component>
  </webservice-description>
 </weblogic-webservices>

而我的EJB使用以下内容公开服务

代码语言:javascript
复制
 @WebService(endpointInterface = "my.company.manCA7.sei.ManCa7SEI")
 @TransactionManagement(TransactionManagementType.CONTAINER)
 @Stateless
 public class ManCa7EndPoint implements ManCa7SEI{
 private final Logger logger = LoggerFactory.getLogger(ManCa7EndPoint.class);
     .
     .
     .
EN

回答 1

Stack Overflow用户

发布于 2013-12-01 00:33:21

我找到了解决办法..。

在注释webservice中,我放置了相同的webservices.xml名称空间,并且工作了!!

内部webservices.xml

代码语言:javascript
复制
<wsdl-port xmlns:ws="http://someserver.com/ManCA7">ws:ManCA7Port</wsdl-port>

EJB内部

代码语言:javascript
复制
@WebService(endpointInterface = "my.company.manCA7.sei.ManCa7SEI",targetNamespace = "http://someserver.com/ManCA7")
@TransactionManagement(TransactionManagementType.CONTAINER)
@Stateless
public class ManCa7EndPoint implements ManCa7SEI{

解决方案是targetNamespace =

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20307201

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档