0
votes

I am trying to call a remote EJB in a Liberty Profile server following the Redbook example (IBM WebSphere Application Server Liberty Profile Guide for Developers, 5.2.3 Developing applications using remote EJB).

All compiles and deploys with no problems, but at run time gives this error message:

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.

What can be wrong? Local EJB example works just fine.

Is it enough to specify the remote EJB just in the client code or has it to be somewhere else too (property file or server.xml)?

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

Only the interface with the @Local annotation is binding and it is shown in the log. The interface with the @Remote annotation is not getting binded and not shown in the log.

What can be the error?

2
Do you have access to websphere admin console? if so can you check that EJB bindings are correct in Applications > Application Types > WebSphere enterprise applications > application_name > EJB references in the administrative consoleBenjamin Caure
In Websphere Liberty there is no such optionsNikeshh Baskaran

2 Answers

0
votes

There is indeed some additional config from this procedure, at the end it is specified to configure ibm-*-bnd.xml from your application:

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

If the @Remote interface is not being bound, then the server.xml either does not include the ejbRemote-3.2 feature, or is missing configuration for the ORB (i.e. the ejbRemote feature will not start if the ORB is not starting properly. For example, does your server.xml contain at least something like the following:

<server>
    <featureManager>
        <feature>ejbRemote-3.2</feature>
    </featureManager>

    <iiopEndpoint id="defaultIiopEndpoint" iiopPort="2809" iiopsPort="2810"/>
</server>