Remote EJB providers

For applications that provide remote EJB beans, consider how to maintain access to remote EJB beans from on-premises clients when migrating this application.

The following Java annotations and classes indicate the use of remote EJB beans:

Remote EJB beans are also indicated by the following elements in the ejb-jar.xml file:


<session>
    <description>My business bean</description>
    <display-name>BusinessLogic bean</display-name>
    <ejb-name>BusinessLogic</ejb-name>  
	<home>com.ibm.ejbs.BusinessLogicHome</home>
	<remote>com.ibm.ejbs.BusinessLogic</remote>
    <ejb-class>com.ibm.ejbs.BusinessLogicSession</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>          
</session>

Applications that contains this code provide EJB beans that can be accessed remotely. If possible, consider migrating the applications that access these beans to the same cloud environment. Also consider connectivity solutions needed if these beans will be accessed by on-premises client applications.

This rule is flagged once per Eclipse project or Java archive.

How to Resolve

If your client application is able to directly access this remote EJB provider after it is moved, no further action is required.

Otherwise, one option is to move the EJB provider application to the cloud with any client applications that access the remote EJB beans. Analyze the client applications for connectivity issues as well. Alternatively, you can use a VPN tunnel, such as the IBM Cloud Secure Gateway, to create a secure connection for your existing on-premise EJB client applications to access this remote EJB provider. For more information about configuring a secure connection, see Configuring a VPN. After you configure your gateway, connect your application to the new destination by using the cloud host and port number that is provided when you created the destination. The following example shows an EJB remote URL:

When you configure a secure connection for calls to remote on-cloud EJB beans, create and install an HTTP tunneling servlet on the cloud application server, and enable tunneling in the client side ORB. For more information, see Enabling HTTP tunneling. Configure the secure client to point to the HTTP tunneling servlet, and use the host and port that are returned from the configuration for your cloud secure connection in the following format:

You can use this technique both when the EJB bean is moved to the cloud and the EJB client is on-premises, and vice versa.

Note: Liberty for Java applications that use remote EJB beans can be deployed to an IBM Cloud instant runtime; however, the remote EJB beans are not remotely accessible with the CORBA/IIOP protocol because of port restrictions in the IBM Cloud environment.