You can create an EJB client JAR
project for an existing EJB project.
About this task
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.
Procedure
- In the Enterprise Explorer view of the Java EE perspective, right-click the EJB project,
and select from the pop-up menu.
- In the Name field, type a name for
the EJB client JAR project.
- 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.
- Click Finish.
Results
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 includes 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, you must 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.