Liberty和Spring Boot 1.4.2的远程EJB问题

时间:2016-11-24 01:02:10

标签: spring-boot ejb-3.1 websphere-liberty

在Spring Boot应用程序中使用Liberty Profile进行远程EJB调用时,我收到以下错误。

org.omg.CORBA.BAD_PARAM: bad address: iiop port is invalid:  vmcid: OMG minor code: 0x8

我的代码如下所示:

InitialContext ctx = new InitialContext();
Object obj = ctx.lookup("corbaloc:iiop:my.host.com:9810#ejb/com/dwl/base/requestHandler/beans/DWLServiceController");
dwlServiceControllerHome = (DWLServiceControllerHome) PortableRemoteObject.narrow(obj, DWLServiceControllerHome.class);

错误追踪:

[err] org.omg.CORBA.BAD_PARAM: bad address: iiop port is invalid:  vmcid: OMG minor code: 0x8  completed: No
[err]   at org.apache.yoko.orb.OCI.IIOP.CorbalocProtocol_impl.parse_address(CorbalocProtocol_impl.java:121)
[err]   at [internal classes]
[err]   at javax.naming.InitialContext.lookup(InitialContext.java:417)

我正在使用JEE 7完整档案Liberty profile 16.0.0.3。

1 个答案:

答案 0 :(得分:0)

您可以尝试在port:

之后添加“NameServiceServerRoot”
InitialContext ctx = new InitialContext();
Object obj = ctx.lookup("corbaloc:iiop:my.host.com:9810/NameServiceServerRoot#ejb/com/dwl/base/requestHandler/beans/DWLServiceController");

dwlServiceControllerHome = (DWLServiceControllerHome) PortableRemoteObject.narrow(obj, DWLServiceControllerHome.class);

我们解决了CORBA.BAD_PARAM错误,将其添加到网址。我们的案例是从Liberty配置文件中调用WAS中已部署的ejb