Creating EJB modules using wizards
You can use wizards to create an EJB module in your Java™ EE project.
Procedure
- In the Java EE perspective, right-click your enterprise application project and select New > EJB Project. The New EJB Project wizard opens.
- In the Name field, type a name for the EJB project. To change the default Project location, clear the Use default location checkbox and click the Browse button to select a new location.
- In the Target runtime drop-down list, select the server that you want to target for your development. Or, create a target runtime environment by clicking New. The target runtime selection affects the compilation and runtime settings by modifying the class path entries for the project. To create an EJB 3.1 project, select the appropriate version of IBM® WebSphere® Application Server.
- Select the EJB module version or accept the default.
- Optional: Select a pre-defined project configuration from the Configurations drop-down list.
- Optional: Modify Configuration: If you
want to modify the configuration details, click modify:
If you are creating an entity, for example, select Java Persistence. Save this configuration with a meaningful name, for example, EJBDevelopmentWithEntityBeans so that you can reference this configuration in any EJB 3.1 projects that are subsequently created.
- Optional: Select Add project to an EAR module to add the new module to an enterprise module (EAR) project. Type a new project name or select an existing enterprise module project from the drop-down list in the EAR Project Name combination box, or, click New Project to launch the New EAR module Project wizard.
- Click Next.
- In the Source Folder field, specify a folder for your source files by clicking the Add Folder... button or accept the default value (appClientModule).
- In the Output Folder field, specify a folder for your output files or accept the default value (build\classes).
- Optional: If in the previous page, you selected Add project to an EAR module, then you are able to create an EJB Client JAR. Select Create an EJB Client JAR module to hold the client interfaces and classes if you want the client interface and classes for your enterprise beans to be kept in a separate EJB client JAR file. This EJB client JAR file is added to the enterprise module as a project utility JAR file. Specify values for the Name and Client JAR URI fields, or accept the defaults. If you select this option, the Deployment Descriptor is generated by default.
- If you cleared the Create an
EJB Client JAR module to hold the client interfaces and
classes checkbox, you can select Generate Deployment Descriptor if
you want to create a deployment descriptor, although the deployment
descriptor is optional in EJB 3.0 and later. The deployment descriptor
stores information relating to the EJB project in an Extensible Markup
Language (XML) file, serving three functions:
- Declaring the contents of the module
- Defining the structure and external dependencies of the beans in the module
- Describing how the enterprise beans are to be used at run time
- Click Finish.
Parent topic: Creating and configuring Java EE projects using wizards

