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
- All hyperlinks on this page refer to localhost on the
default ports for the respective appservers.
- 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.
- 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:
- This
readme.html
file
- The Java source code for the example Servlets
- Enterprise Application Archive (EAR) file containing the
example applications for deployment to the supported
application servers
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
- Log in to JSAS Administration Console.
- In "Enterprise Applications", click "Deploy..."
- In "Deploy Enterprise Application", enter the path to
ejb-examples.ear
and click "Next".
- Name the application "VhiEjbExamples",
check the Verifier check box and click "Next" again.
- If the application deployment was successful, proceed to
configuration instructions,
now running on your appserver.
WebSphere 6.x
- Log in to WebSphere Administrative Console.
- In "Applications/Enterprise Applications", click "Install"
- Specify the path to
ejb-examples.ear
and click "Next".
- Accept the defaults and click "Next".
- On "Step 1: Select installation options", accept the defaults and click "Next".
- On "Step 2: Map modules to servers", accept the defaults and click "Next".
- On "Step 3: Provide options to perform the EJB Deploy", accept the defaults and click "Next".
- 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.
- 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".
- On "Step 5: Map JCA resource references to resources",
accept the defaults and click "Next".
- 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".
- On "Application Resource Warnings" page, click "Continue".
We will address the warnings in the configuration phase.
- On "Step 8: Map virtual hosts for Web modules", accept the defaults and click "Next".
- On "Step 9: Ensure all unprotected 2.x methods have the correct level of protection",
accept the defaults and click "Next".
- On "Step 10: Summary", click "Finish".
- On the "Installing" page click "Save to Master Configuration".
- On "Enterprise Applications > Save" click "Save".
- Back on the "Enterprise Applications" page, check
"VHI EJB Examples" and click "Start".
- If the application deployment was successful, proceed to
configuration instructions,
now running on your appserver.
WebLogic 9.x
- Log in to BEA WebLogic Administration Console.
- Click "Lock & Edit".
- Under "Domain Structure", click "Deployments".
- Under "Deployments", click "Install".
- Browse to
ejb-examples.ear
and click "Next".
- Click the "Install this deployment as an application" radio button, then click "Next".
- On "Install Application Assistant", name the application
"VHI EJB Examples", accept the other defaults and click "Next".
- On "Install Application Assistant", review your choices and click "Next".
- After the install completes, click "Activate Changes".
- Click "Lock & Edit".
- Under "Domain Structure", click "Deployments".
- Under "Deployments", select "VHI EJB Examples (Prepared)".
- Click "Start>Servicing all requests".
- On "Start Application Assistant", click "Yes".
- 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
- Name: CICSAcctsDemoPool
- JNDI Name: eis/CICSAcctsDemo
- Maximum Pool Size: 5
- Transaction Support: NoTransaction
Properties
- serverName: localhost
- resourceName: CICSAcctsDemo
PurchasesDemo Pool
Pool Settings
- Name: PurchasesDemoPool
- JNDI Name: eis/PurchasesDemo
- Maximum Pool Size: 5
- Transaction Support: NoTransaction
Properties
- serverName: localhost
- resourceName: PurchasesDemo
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.