Attachmate Verastream® Host Integrator
EJB Examples Readme

Overview

You use WebBuilder to generate EJBs for use with the Attachmate Verastream Host Integrator J2EE Connector (resource adapter or RA). Unlike the examples for the RA, we cannot assemble J2EE packages for EJBs, because they do not exist until you generate them in WebBuilder.

This document assumes you have generated EJBs for the CICSAcctsDemo and PurchasesDemo models. This document describes the steps to package the example application and deploy it to your application server.

Notes

  1. All hyperlinks on this page refer to localhost on the default ports for the respective appservers.
  2. Application server administration consoles may change without notice. The instructions are typical for the admin consoles in effect at the time of this writing. Your results may vary.
  3. Most problems with deployment and operation can be traced to invalid configuration. Double-check JNDI names, capitalization, security settings, etc.

Example Contents

The examples/j2ee/ejb directory contains the following:

Packaging

We have pre-configured ejb-examples.ear to accept your generated CICSAcctsDemo-ejb.jar and PurchasesDemo-ejb.jar. Use the JAR tool from the Java SDK, or other tool capable of working with the JAR format, such as WinZip to add your generated ejb jars to the root directory of ejb-examples.ear.

Deployment

This section explains how to deploy the Attachmate Verastream Host Integrator EJB Examples to the supported application servers and run them.

Sun JSAS 8.x & 9.x

  1. Log in to JSAS Administration Console.
  2. In "Enterprise Applications", click "Deploy..."
  3. In "Deploy Enterprise Application", enter the path to ejb-examples.ear and click "Next".
  4. Name the application "VhiEjbExamples", check the Verifier check box and click "Next" again.
  5. If the application deployment was successful, proceed to configuration instructions, now running on your appserver.

WebSphere 6.x

  1. Log in to WebSphere Administrative Console.
  2. In "Applications/Enterprise Applications", click "Install"
  3. Specify the path to ejb-examples.ear and click "Next".
  4. Accept the defaults and click "Next".
  5. On "Step 1: Select installation options", accept the defaults and click "Next".
  6. On "Step 2: Map modules to servers", accept the defaults and click "Next".
  7. On "Step 3: Provide options to perform the EJB Deploy", accept the defaults and click "Next".
  8. On "Step 4: Provide JNDI Names for Beans", enter "ejb/CICSAcctsDemo" and "ejb/PurchasesDemo" (respectively for each EJB) in the JNDI name column. Accept the other defaults and click "Next". Note: the next steps run out of order.
  9. On "Step 6: Map EJB references to beans", enter "ejb/CICSAcctsDemo" and "ejb/PurchasesDemo" (respectively for each reference binding) in the JNDI name column. Accept the other defaults and click "Next".
  10. On "Step 5: Map JCA resource references to resources", accept the defaults and click "Next".
  11. On "Step 7: Map resource references to resources", enter "eis/CICSAcctsDemo" and "eis/PurchasesDemo" (respectively for each reference binding) in the JNDI name column. Accept the other defaults and click "Next".
  12. On "Application Resource Warnings" page, click "Continue". We will address the warnings in the configuration phase.
  13. On "Step 8: Map virtual hosts for Web modules", accept the defaults and click "Next".
  14. On "Step 9: Ensure all unprotected 2.x methods have the correct level of protection", accept the defaults and click "Next".
  15. On "Step 10: Summary", click "Finish".
  16. On the "Installing" page click "Save to Master Configuration".
  17. On "Enterprise Applications > Save" click "Save".
  18. Back on the "Enterprise Applications" page, check "VHI EJB Examples" and click "Start".
  19. If the application deployment was successful, proceed to configuration instructions, now running on your appserver.

WebLogic 9.x

  1. Log in to BEA WebLogic Administration Console.
  2. Click "Lock & Edit".
  3. Under "Domain Structure", click "Deployments".
  4. Under "Deployments", click "Install".
  5. Browse to ejb-examples.ear and click "Next".
  6. Click the "Install this deployment as an application" radio button, then click "Next".
  7. On "Install Application Assistant", name the application "VHI EJB Examples", accept the other defaults and click "Next".
  8. On "Install Application Assistant", review your choices and click "Next".
  9. After the install completes, click "Activate Changes".
  10. Click "Lock & Edit".
  11. Under "Domain Structure", click "Deployments".
  12. Under "Deployments", select "VHI EJB Examples (Prepared)".
  13. Click "Start>Servicing all requests".
  14. On "Start Application Assistant", click "Yes".
  15. If the application deployment was successful, proceed to configuration instructions, now running on your appserver.
Note: You cannot run the applications ejb-examples and jca-examples simultaneously in WebLogic. The error
"A Resource Adapter may only be accessed from within the same application from which it was deployed."
will result. Stop one application before installing or starting the other.

Other Application Servers

Consult the documentation for your application server for specific information describing how to deploy applications. Many servers require some sort of descriptor file along with, or within the EAR file. As with WebLogic, configuration and deployment is often a one-step process, sometimes as simple as copying a file to a "deploy" directory.

You will need to set the following parameters:

CICSAcctsDemo Pool

Pool Settings
Properties

PurchasesDemo Pool

Pool Settings
Properties
If the application deployment is successful, proceed to the examples page now running on your appserver, e.g., http://localhost:port/vhi/ejb/examples/index.html, where port is the port on which your appserver publishes web applications.