【发布时间】:2019-03-21 06:45:15
【问题描述】:
我正在尝试按照红皮书示例(IBM WebSphere Application Server Liberty Profile Guide for Developers,5.2.3 Developing applications using remote 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 注释的接口未绑定,也未显示在日志中。
可能是什么错误?
【问题讨论】:
-
您可以访问 websphere 管理控制台吗?如果是这样,您能否在管理控制台中的 Applications > Application Types > WebSphere Enterprise Applications > application_name > EJB references 中检查 EJB 绑定是否正确
-
在 Websphere Liberty 中没有这样的选项
标签: websphere websphere-liberty ejb-3.2