Importing an enterprise bean (EJB) Java archive (JAR) file migrates
the EJB JAR file to an assembly tool.
Before you begin
This topic assumes you have assembled an EJB JAR file and want to
work with it in an
assembly
tool such as the Application Server Toolkit (AST), Rational Application
Developer (RAD) or Rational Web Developer.
This topic also assumes that
you have started the assembly tool and
have configured the assembly tool for
work on Java 2 Platform, Enterprise Edition (J2EE) modules.
About this task
Importing an existing EJB JAR file into an assembly tool migrates
the JAR file to the assembly tool so you can further configure and assemble
an application that contains the EJB module.
Procedure
- Click File > Import > EJB JAR file > Next. Alternatively,
you can right-click EJB Projects in a view such as the Project Explorer
view and click Import > EJB JAR file. Or, on Windows platforms, you
can drag the enterprise bean JAR file and drop it on a view.
- In the Import dialog, define the EJB JAR file and project:
- Specify the enterprise bean JAR file to import. Use Browse to
locate the JAR file and specify its full path name.
- Specify an EJB project name. For example, if you are importing
the HelloWorld.jar file, you might name the project HelloWorld.
Click New, specify HelloWorld for the project name, specify
whether you want to use the EJB 1.1, 2.0 or 2.1 specification, and click Next.
- Optional: Specify whether to overwrite and delete
existing resources without warning.
- Select a target server. To use an application assembly
service of WebSphere Application Server, select the WebSphere Application
Server v6.0 target server. Available assembly services include ActivitySession, Application profiling, Internationalization, and Last participant support.
- If you want to add EJB components to an enterprise application
(EAR file), select Add module to an EAR project.
- Specify a new or existing enterprise application (EAR) project
to be associated with your EJB project for purposes of deployment.
Select an existing enterprise application project from the drop-down
list or type a new project name. Or, click New and create a new enterprise application. Note that if you type
a new EAR project name, the EAR project is 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 click New and create a new
enterprise application.
- Specify whether you want to add support for annotated Java classes.
- Click Finish.
Results
A new EJB project is created. Files for the EJB project are shown
in the Project Explorer view under Enterprise Applications and EJB
Projects.
What to do next
After importing an EJB JAR file, you can
edit EJB deployment descriptors as needed and
deploy the module or its application to an application
server.
You can generate EJB deployment code and deploy an EJB module to
a target server in one step.
In the Project Explorer view, right-click on the EJB project and click Deploy.
For
more information, refer to topics under EJB assembly in the Application
Server Toolkit information center that accompanies this information center.