Importing EJB files

 

Importing EJB files

Importing an enterprise bean (EJB) Java archive (JAR) file migrates the EJB JAR file to an assembly tool.

This article assumes you have assembled an EJB JAR file and want to work with it in an assembly tool such as the Application Server Toolkit (AST) or Rational Web Developer.

This article also assumes that you have started the assembly tool and have configured the assembly tool for work on Java 2 Platform, Enterprise Edition (J2EE) modules.

Importing an existing EJB JAR file into an assembly tool migrates the JAR file to the assembly tool so you can further configure and assemble
an application that contains the EJB module.

  1. Click File > Import > EJB JAR file > Next . Alternatively, you can right-click EJB Projects in a view such as the Project Explorer view and click Import > EJB JAR file . Or, on Windows platforms, you can drag the enterprise bean JAR file and drop it on a view.

  2. In the Import dialog, define the EJB JAR file and project:

    1. Specify the enterprise bean JAR file to import. Use Browse to locate the JAR file and specify its full path name.

    2. Specify an EJB project name. For example, if you are importing the HelloWorld.jar file, you might name the project HelloWorld. Click New , specify HelloWorld for the project name, specify whether you want to use the EJB 1.1, 2.0 or 2.1 specification, and click Next .

    3. Optional: Specify whether to overwrite and delete existing resources without warning.

    4. Select a target server. To use an application assembly service of WebSphere Application Server, select the WebSphere Application Server v6.0 target server. Available assembly services include ActivitySession, Application profiling, Internationalization, and Last participant support.

    5. If you want to add EJB components to an enterprise application (EAR file), select Add module to an EAR project .

    6. Specify a new or existing enterprise application (EAR) project to be associated with your EJB project for purposes of deployment. Select an existing enterprise application project from the drop-down list or type a new project name. Or, click New and create a new enterprise application. Note that if you type a new EAR project name, the EAR project is 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, click New and create a new enterprise application.

    7. Specify whether you want to add support for annotated Java classes.

    8. Click Finish .

ResultA new EJB project is created. Files for the EJB project are shown in the Project Explorer view under Enterprise Applications and EJB Projects .

 

What to do next

After importing an EJB JAR file, you can edit EJB deployment descriptors as needed and deploy the module or its application to an application server.

You can generate EJB deployment code and deploy an EJB module to a target server in one step. In the Project Explorer view, right-click on the EJB project and click Deploy .

For more information, refer to articles under EJB assembly in the Application Server Toolkit information center that accompanies this information center.


Related tasks
Assembling EJB modules
Assembling applications