Enterprise Java™ Bean (EJB) methods with remote interfaces

EJB methods with remote interfaces can be remotely accessed or hosted by CICS® Liberty by using RMI-IIOP technologies. You can enable remote EJB support with the ejbRemote-3.2 feature.

To configure CICS Liberty to run an application which accesses EJB methods with remote interfaces, you must enable the ejbRemote-3.2 feature, by using the steps in this topic. To host EJBs in CICS Liberty so they can be called by other JVMs, you must enable the ejbRemote-3.2 feature.

When you use remote EJB interfaces, there are considerations that you must be aware of. For more information, see Using enterprise JavaBeans with remote interfaces on Liberty.

Accessing EJB methods with remote interfaces
  1. To enable this feature, update the server.xml file to add the ejbRemote-3.2 feature:
    <featureManager>
        <feature>ejbRemote-3.2</feature>
    </featureManager>
  2. Configure your application binding files, for example ibm-*-bnd.xml, for remote EJB references that are defined either in the deployment descriptor <ejb-ref>, or with source code annotations, for example @EJB. A binding is not required for EJB references that provide a lookup name, either on the annotation or in the deployment descriptor. In the binding file, the EJB reference can be bound by using one of the java: names for an EJB or with one of the corbaname:names:
    @EJB(name="TestBean")
        TestRemoteInterface testBean;

    The binding is defined:

    <ejb-ref name="TestBean" binding-name="corbaname:rir:#ejb/global/TestApp/TestModule/TestBean!test.TestRemoteInterface"/>
  3. Configure your application client to include stub classes.
Hosting EJB methods with remote interfaces
  1. To enable this feature, update the server.xml file to add the ejbRemote-3.2 feature:
    <featureManager>
        <feature>ejbRemote-3.2</feature>
    </featureManager>
  2. Configure the IIOP server to customize ports and security settings. For more information, see Configuring IIOP-RMI Transport for Remote EJBs.
  3. Create an EJB application. For more information, see Creating an Enterprise JavaBeans (EJB) project.
  4. Generate stub classes. In Eclipse, right click on EJB project > Java EE Tools > Create EJB Client JAR.
  5. Deploy the EJB application to CICS Liberty as part of an EAR. For more information, see Creating an Enterprise Application project.
  6. Check the Liberty messages.log file to ensure the EJB is enabled are bound to a namespace. The message that you should see is:
    CNTR0167I: The server is binding the ejb.remote.ejb.view.MyBeanRemote interface of the 
    MyBean enterprise bean in the ejb.remote.ejb.jar module of the ejb.remote application. 
    The binding location is: java:global/ejb.remote/ejb.remote.ejb/MyBean!remote.ejb.view.MyBeanRemote


ejb_remote_interfaces.html | Timestamp icon Last updated: Monday, 5 June 2017