Deploying to an EJB

You can deploy the J2C application to an EJB.

Once you have created your J2C application, you can create an EJB to wrap your J2C application. For more information on creation EJBs, view the 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 Version 6.0 and test environments for legacy application servers such as, WebSphere Application Server Version 5.1 and WebSphere Application Server Version 5.0.

The test environment that you use to run your web application depends on how the application is generated. For example, if you selected servlet version 2.4 (J2EE Version 1.4) when you defined the dynamic web project for your application, you must select WebSphere Application Server Version 6.0 as your target server and you must test your application using the WebSphere Application Server Version 6.0 Test Environment.

To create an EJB to deploy your J2C Java™ bean, complete the following steps:

  1. In the Deployment Information page, select Create J2EE resource.
  2. In the J2EE Resource Type, select EJB.
  3. Click Next.
  4. On the EJB Creation page appears. To create an EJB project, clickNew.
  5. In the Name field, type a name for the EJB project. To change the default Project location, click the Browse button to select a new location.
  6. Click Show Advanced.
  7. In the EJB version list, select the EJB specification version to which you want your EJB project to adhere.
    1. If you plan on using EJB 2.1 enterprise beans, you must specify an EJB 2.1 project. You can add EJB 1.1 enterprise beans to EJB 2.x projects. An EJB 2.1 project must exist in a J2EE 1.4 enterprise application project. An EJB 2.0 project requires a minimum level of J2EE 1.3 for its enterprise application project.
  8. Resource Reference
    1. In the Resource Reference field, provide a resource reference name. 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.
    2. In the JNDI lookup name field, ensure that the correct name of your JNDI lookup appears. If it does not appear or is not correct, type the correct project name.
  9. In the Target server list, select the application server that you want to target for your development. This selection affects the compilation and runtime settings by modifying the class path entries for the project. Specify whether you want to add the
    Note: If you type a new EAR project name, the EAR project will be created in the default location with the lowest compatible J2EE 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.
  10. Optional: Select the Create an EJB Client JAR Project to hold the client interfaces and classes check box if you want the client interface classes for your enterprise beans to be kept in a separate EJB client JAR file. This EJB client JAR file will be added to the enterprise application as a project utility JAR file.
  11. Optional: If you are creating an EJB Client JAR project, click Next to specify the client JAR project options.
  12. If you want to add annotations to your Java source code, select Add support for annotated Java classes.
  13. If you want to create a stateless session bean, select Create a default stateless session bean.
  14. In the EJB Creation page, in the EAR Project field, ensure that the correct name of your EAR project appears. If it does not appear, or is not correct, type the correct EAR project name
  15. In the Session bean name field, provide a name for your Session bean.
  16. In the Session type list, select the type of your Session bean (Stateless, Stateful)
  17. In the Transaction type list, select the type of your transaction (Container, Bean)
  18. In the JNDI Name field, ensure that the correct name of your JNDI project appears. If it does not appear, or is not correct, type the correct JNDI name
  19. Select Remote client view, if you want to include a Remote client view. If so, ensure that the correct names appear in the Remote home interface and the Remote interface If hey do not appear, or are not correct, type the correct names of the remote home interface and remote interface.
  20. Select Local client view, if you want to include a Local client view. If so, ensure that the correct names appear in the Local home interface and the Local interface . If they do not appear, or are not correct, type the correct names of the local home interface and local interface.
  21. If you selected Configure Resource Adapter Deployment on the Deployment Information page, click Next to go specify the RAR settings. page.
  22. If you did not select Configure Resource Adapter Deployment on the Deployment Information page, click Finish.
Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.