You can deploy your J2C application to an EJB.
Before you begin
Once you have created your J2C application, you can create an EJB to wrap your J2C
application. For more information on creating EJB projects, see EJB documentation.You can test your application using one
of the test environments included in the development platform. For example, you can include test
environment for WebSphere® Application Server V7.0, V8.0,
or V8.5. Test environments for legacy application servers such as WebSphere Application Server Versions 6.1, 6.0. and 5.1 are not
supported.
Restriction: The artifacts created from the
following J2C wizards are supported to run only on the WebSphere Application
Server classic server, not on Liberty server:
- Command Bean
- J2C Bean
- Web Page, Web Service, or EJB from J2C Java Bean
Only classes that are generated from the CICS/IMS
Data Binding wizard will be supported on Liberty server,
provided that the marshall.jar file is packaged
with the deployed application. If you have a licensed copy of RAD, marshall.jar is
listed in the redistributable files section of the documentation.
The licensed redistributable file is located in the plug-in com.ibm.ccl.commonj.connector.metadata.
Note
that marshall.jar is not part of the Liberty
runtime. To have the generated class run on a Liberty server, you
also need to follow instructions on Enabling generated record data in outbound optimized
local adapter connections in Liberty to add marshall.jar to
the Liberty server.
Procedure
- Open the Web Page, Web Service, or EJB from
J2C Java bean wizard.
- If you are creating an EJB for a J2C Java™ bean that exists in your workspace, follow
these steps:
- Select File > New > Other > J2C > Web Page, Web Service,
or EJB from J2C Java bean.
- Click Next.
- On the J2C Java bean selection
page, click Browse to locate your J2C Java bean. If you know the letter
that the name of your J2C Java bean starts with, type that letter in the Select entries field, or type ? to see a list of all the
J2C Java beans. Highlight your
selection and click OK.
- Click Next.
- If you have followed the J2C Java bean wizard to the end, then on the Deployment Information
page, select Create a Web page, Web Service or EJB from
the J2C bean
- In the Deployment Information page, select Create
a Web page, Web Service or EJB from the J2C bean.
- In the Java EE Resource Type, select EJB, and click Next. Click Configure Resource Adapter Deployment, if you want to
configure the resource adapter deployment, and click Next.
- On the EJB Creation page,
- The EJB project, which is disabled,
contains your EJB project name.
- In the EAR project field, ensure
that your EAR project name appears, click Browse to locate your EAR project, or click New to
create a new EAR project.
For information on creating the
EJB and EAR projects, see
Creating an EJB project.
Note: If you type a new EAR project name, the EAR project
will be created in the default location with the lowest compatible Java EE version based on the version
of the project being created. If you want to specify a different version
or a different location for the enterprise application, you must use
the New Enterprise Application Project wizard.
- In the Session type field, select
the type of session bean you want to create:
- In the Transaction type field,
select the type of transaction you want to create:
- In the JNDI name field, accept
the default or type a name for your JNDI.
- Click Advanced.
- Disable EJB transaction:
Important: If you selected the CICS® transaction
resource adapter, using a managed connection, you must click
Disable EJB transaction:
- In the Resource reference field, type a
name for your resource reference. This resource reference maps the
name used in the application to the actual JNDI resource name specified
on the runtime server. Creating a resource reference is the preferred
method of managing connections, because it makes your application
code less server dependent. That is, if you want to use a different
server on which to run your application, you can create a new resource
reference that binds to the new server without needing to change your
application source code. Once you provide a resource reference name,
the wizard will confirm that the JNDI name exists in the server.
- . In the Resource Adapter Deployment page, select the type of
deployment you want, and click Finish.
- Deploy as Stand Alone
- Deploy within EAR