Deploying to an EJB 2.1

You can deploy the J2C application to an EJB 2.1.

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: J2C applications are supported to run only on the WebSphere Application Server.

Procedure

  1. 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:
      1. Select File > New > Other > J2C > Web Page, Web Service, or EJB from J2C Java bean.
      2. Click Next.
      3. 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.
      4. 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
  2. In the Deployment Information page, select Create a Web page, Web Service or EJB from the J2C bean.
  3. 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.
  4. On the EJB Creation page,
    1. The EJB project, which is disabled, contains your EJB project name.
    2. 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.
    3. In the Session bean name field, type a name for your session bean.
    4. In the Session bean package field, type a name for your session bean package, or use the same package you created in your J2C bean.
    5. In the Session type field, select the type of session bean you want to create:
      • Stateless
      • Stateful
    6. In the Transaction type field, select the type of transaction you want to create:
      • Container
      • Bean
    7. In the JNDI name field, accept the default or type a name for your JNDI.
    8. In the Remote home interface field, accept the default or type a name for your remote home interface.
    9. In the Remote interface field, accept the default or type a name for your remote interface.
    10. In the Local home interface field, accept the default or type a name for your local home interface.
    11. In the Local interface field, accept the default or type a name for your local interface.
    12. Click Advanced.
      • Disable EJB transaction:
        Important: If you selected the CICs transaction resource adapter, using a managed connection, you must click Disable EJB transaction:
        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

Feedback