日志中未显示远程EJB绑定-Websphere Liberty

时间:2019-03-21 06:45:16

标签: websphere websphere-liberty ejb-3.2

我正在按照Redbook示例(《 IBM WebSphere Application Server Liberty Profile Guide for Developers,5.2.3使用远程EJB开发应用程序》)尝试在Liberty Profile服务器中调用远程EJB。

所有编译和部署都没有问题,但是在运行时会显示以下错误消息:

Error 404: javax.servlet.UnavailableException: SRVE0319E: For the [com.ibm.itso.ejbRemote.HelloRemoteServlet] servlet, com.ibm.itso.ejbRemote.HelloRemoteServlet servlet class was found, but a resource injection failure has occurred. CWNEN0030E: The server was unable to obtain an object instance for the java:comp/env/com.ibm.itso.ejbRemote.HelloRemoteServlet/helloRemoteBean reference. The exception message was: CWNEN1003E: The server was unable to find the java:global/ITSORemote/ITSORemoteEJB/HelloRemoteEJB!com.ibm.itso.ejbRemote.view.HelloRemoteEJBRemote binding with the com.ibm.itso.ejbRemote.view.HelloRemoteEJBRemote type for the java:comp/env/com.ibm.itso.ejbRemote.HelloRemoteServlet/helloRemoteBean reference.

有什么问题?本地EJB示例很好用。

仅在客户端代码中指定远程EJB是否足够?或者它也可以位于其他位置(属性文件或server.xml)?

@EJB(lookup="java:global/ITSORemote/ITSORemoteEJB/HelloRemoteEJB!com.ibm.itso.ejbRemote.view.HelloRemoteEJBRemote") 
 private HelloRemoteEJBRemote helloRemoteBean;

仅具有@Local批注的接口是绑定的,并显示在日志中。带有@Remote批注的界面未绑定,也未显示在日志中。

可能是什么错误?

2 个答案:

答案 0 :(得分:0)

procedure确实还有一些其他配置,最后指定是从您的应用程序配置ibm-*-bnd.xml:

<ejb-ref name="helloRemoteBean" binding-name="java:global/ITSORemote/ITSORemoteEJB/HelloRemoteEJB!com.ibm.itso.ejbRemote.view.HelloRemoteEJBRemote"/>

答案 1 :(得分:0)

如果未绑定robabilityCol接口,则server.xml要么不包含@Remote功能,要么缺少ORB的配置(即如果ejbRemote功能不能启动, ORB无法正常启动。例如,您的server.xml是否至少包含以下内容:

ejbRemote-3.2
相关问题