Importing EJB JAR files

You can import beans and other metadata from an EJB JAR file into a new or existing EJB project.

To import an EJB JAR file into an EJB project using the Import wizard:

  1. In the J2EE perspective, click File > Import > EJB JAR file and click Next.
  2. In the EJB JAR file combination box, enter the location and name of the EJB JAR file that you want to import. You can click the Browse button to select the JAR file from the file system.
  3. In the EJB Project combination box, type a new project name or select an EJB project from the drop-down list.
  4. In the Target runtime drop-down list, select the application server that you want to target for your development. If no target servers exist, create one using the New button. The target server choice affects the run time settings by modifying the class path entries for the project.
  5. Specify whether you want to add the new module to an enterprise application (EAR) project.
  6. In the EAR application combination box, type a new project name or select an existing enterprise application project from the drop-down list. Or, click the New button to launch the New EAR Application Project wizard.
    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.
  7. Click Finish to import the EJB JAR file.

Tip: In the Project Explorer view you can also copy enterprise beans by dragging and dropping them from one EJB project to another EJB project. The import wizard will open to help you merge existing enterprise beans.

Tip: The following paragraph applies to Windows. You can quickly drag and drop an EJB JAR file from the Windows Explorer or desktop onto the Project Explorer view. The Import wizard will open with appropriate fields already populated. If you drop on an existing EJB module, the wizard will import into that EJB module. If you drop on an enterprise application, the wizard will bind the new EJB module to this EAR.

Note: The .ser files in an EJB 1.0 JAR are converted into the ejb-jar.xml file for EJB 1.1 during an import.

(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.