Creating EJB projects

An EJB project is used to organize the resources contained in an EJB module.

An EJB module is used to assemble one or more enterprise beans into a single deployable unit. It is deployed in a standard Java archive (JAR) file. An EJB module can be used as a standalone application, or it can be combined with other modules to create a J2EE enterprise application. An EJB module is installed and run in an enterprise bean container. An EJB project must be referenced by an enterprise application project (defined as a module in an EAR) in order to be deployed successfully and run on a server.

An EJB module contains the following:

To create a new EJB project:

  1. In the J2EE perspective, select File > New > Other > EJB > EJB Project. The New EJB Project wizard opens.
  2. In the Project Name field, type a name for the EJB project.
  3. Optional: To use a different workspace directory for your EJB project, modify the settings for Project contents.
    Important: If you specify a non-default project location that is already being used by another project, the project creation will fail.
  4. In the Target runtime drop-down 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. Use the New button if a target runtime does not exist, or if you want to use a different one.
  5. Optional: Select the Add project to an EAR check box to add the new module to an enterprise application (EAR) project. Type a new project name or select an existing enterprise application project from the drop-down list in the EAR Project Name combination box. Or, click the New button to launch the New Enterprise Application Project wizard.
  6. Click Next.
  7. Select the appropriate Project Facets for your EJB project. A project facet is a set of internal functions that add support for a given technology.
  8. Click Next.
  9. Optional: Change the value of Source Folder to change the directory where the Java source files are stored.
  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. You can also modify the Name of the EJB Client JAR project, or the name (Client JAR URI) of the client JAR file.
  11. Click Finish.

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