Creating an EJB client JAR project
You can create an EJB client JAR project for an existing EJB project.
If you have an existing EJB project that currently does not take advantage of the EJB client JAR specification and tooling, you can quickly create an EJB client JAR project for the EJB project. The EJB client JAR project is exported as an EJB client JAR file when the application is exported.
When you create an EJB Client JAR project for an existing EJB project, all Java JAR dependencies are updated appropriately. In other words, all Java project references on the Java build paths and the MANIFEST class path entries are modified. The EJB client JAR is added as a utility JAR to any EAR projects that include the EJB project. Any remote and local client interfaces are moved from the EJB project to the EJB client JAR project. The interfaces are moved to the new project, which is categorized in the Project Explorer under Other projects.
To create an EJB client JAR project for an existing EJB project:
- In the Project Explorer view of the J2EE perspective, right-click the EJB module, and select EJB Client JAR > Create EJB Client JAR Project from the pop-up menu. The EJB Client JAR Creation wizard opens.
- In the Client JAR URI field, type a name for the EJB client JAR file. For this URI value, you need to enter a value relative to the EJB JAR file with an EAR file.
- In the Name field, type a name for the EJB client JAR project.
- To change the default Project location, click the Browse button to select a new location. If you specify a non-default project location that is already being used by another project, the project creation will fail.
- Click Finish.
The EJB client JAR project is created, any remote and local interface classes are moved to the EJB client JAR project, class paths are updated with appropriate references, and the EJB client JAR project is added as a project utility JAR file to any enterprise application (EAR) project that includes the EJB project.
Important: If you use the Export EJB JAR file wizard to export an EJB project, the export wizard does not include an EJB project's associated EJB client JAR project. To include the EJB client JAR file, it is recommended that you export the enterprise application EAR file that contains the EJB project. The resulting EAR file will include any dependent EJB client JAR files as utility JAR files. Alternatively, you can remove the EJB client JAR file before exporting the EJB project, or export the EJB client JAR project separately as a JAR file. Another option for a team environment is to export the projects together. See Exporting projects for sharing.Restriction: If you want to create an EJB client JAR project for an existing EJB project that has already been deployed, first manually delete all deployment code from the EJB project. After the deployment code is deleted from the EJB project, you can create the EJB client JAR project and redeploy the EJB project.
Related concepts
EJB client JAR projects
Related tasks
Removing an EJB client JAR project