websphere liberty 8.5.5.9远程ejb查找失败

时间:2017-02-20 09:21:35

标签: ejb websphere-liberty

我在本地计算机上创建了两个自由实例。我在服务器X中部署了一个包含远程ejb的war模块,并在服务器Y中部署了另一个war,它必须从服务器X远程查找ejb。

以下是从宁静的网络服务中查找ejb的代码。

Properties p = new Properties();
p.setProperty("java.naming.provider.url", "corbaname:iiop:localhost:2809");
InitialContext context = new InitialContext (p);
context.lookup("corbaname:rir:#ejb/global/caching/CachingServiceBean!com%5c.ejb%5c.CachingService");

当我尝试调用Web服务时,我会遇到异常

  

本地对象不支持DII操作

enter image description here

P.S。 我在具有不同端口号的服务器上启用了ejbRemote功能。

我将查询字符串更改为“corbaloc:iiop:localhost:2809 / NameService#ejb / global / caching / CachingServiceBean!com%5c.ejb%5c.CachingService”然后我收到以下错误

enter image description here

然后我将查询字符串更改为“corbaname:iiop:localhost:2809 / NameService#ejb / global / caching / CachingServiceBean!com%5c.ejb%5c.CachingService”然后我收到以下错误

enter image description here

在GitHub上检查apache geronimo-yoko实现后,我明白我必须使用corbaloc:iiop:localhost:2809。但我仍然得到由

引起的异常
  

org.omg.CORBA.OBJECT_NOT_EXIST:无法派遣 - 未找到仆人或POA

我使用了以下网址但没有运气:

  1. corbaloc:IIOP:本地主机:2809 /全球/缓存/ CachingServiceBean com.ejb.CachingService
    1. corbaloc:IIOP:本地主机:2809 /#EJB /全球/缓存/ CachingServiceBean com.ejb.CachingService 3.corbaloc:IIOP:本地主机:2809 /缓存/ CachingServiceBean com.ejb.CachingService 4.corbaloc:IIOP:本地主机:2809 / EJB /全球/缓存/ CachingServiceBean com.ejb.CachingService

1 个答案:

答案 0 :(得分:0)

我认为问题在于包装。我把我的ejb打包成了一个战争模块。

我按照本页http://www.redbooks.ibm.com/redpieces/abstracts/sg248076.html中提到的PDF中描述的步骤进行操作,现在一切正常。

我使用corbaname :: host:port语法来查找远程ejb而不是corbaloc:iiop:host:port

将我的ejb包装在一个耳朵后,它开始工作。