Using EJB Access Beans with Java application clients

With WebSphere, Java application clients consist of the following models:

For more information about these client modules, refer to the WebSphere Knowledge Center documentation.

The following sections assume that you have chosen to use a Java EE application client. If you are using a Java thin application client, consult the WebSphere Knowledge Center for the instructions that are appropriate for your WebSphere release.

Complete the following steps to use EJB Access Beans with a Java application client:

  1. Start with a ZIETrans EJB project that contains one or more macros, Integration Objects, and other resources, and a ZIETrans project to which you have exported EJB Access Beans from the ZIETrans EJB project.
  2. Create a Java EE application client as documented in the Knowledge Center for your version and edition of WebSphere Application Server. To follow these instructions, choose to generate a Main class, and a deployment descriptor. Put this new project into the same enterprise archive (EAR file) as the ZIETrans EJB project. Add these jar files as dependent jars:
    • The EJB .jar file of the ZIETrans EJB project
    • hatscommon.jar
  3. Move your EJB Access Beans to the application client project. Copy the IntegrationObject folder that holds the EJB Access Beans from the ZIETrans project to the appClientModule directory of the application client project.
  4. Build your test client in the Main class that was generated in your application client by implementing the code to instantiate your EJB Access bean and run it.
  5. If you are using the Java EE application client, add the EJB reference and environment variables to the client deployment descriptor:
    1. Open META-INF\application-client.xml.
    2. On the Design tab of the Application Client Descriptor Editor, do the following:
      1. Click Add and choose to add an environment variable:
        • Name: Copy the value of the last part of the HPUBEJB2_REFERENCE string in the EJB Access Bean into this field. For example, it might say
          HPUBEJB2_REFERENCE1318657356
          .
        • Type: java.lang.String
        • Value: ejb/ejb_project_name, where ejb_project_name is the name of your ZIETrans EJB project.
      2. Click Add and choose to add an EJB reference:
        • EJB Reference name: ejb/ejb_project_name, where ejb_project_name is the name of your ZIETrans EJB project.
        • EJB Reference type: Session
        • Home: com.ibm.HostPublisher.EJB.HPubEJB2Home
        • Remote: com.ibm.HostPublisher.EJB.HPubEJB2
        • EJB link: ejb_project_name, where ejb_project_name is the name of your ZIETrans EJB project.
  6. Publish the EAR file to your test server.
  7. Export the application client. From the Navigator view, right click the name of the application client project and select Export. Export it as an EAR file.