Building an EJB Module
See Also
There are two ways to build an EJB module:
- As part of a Java EE application. The IDE packages all of the necessary
JAR files as part of the Java EE application and not as part of the individual
modules. This is the most common way of building an EJB module.
- As a stand-alone EJB module. The IDE packages the necessary JAR files
with the EJB module JAR file.
To build an EJB module as part of an enterprise application:
- In the Projects window, expand the enterprise application's Java EE Modules
node and make sure that the EJB module is listed. If you have not added the
EJB module to the enterprise application, right-click the Java EE Modules node,
choose Add Java EE Module, and select the EJB module.
- Right-click the enterprise application project and choose Build.
Or, if the enterprise application project is the main project, choose Run
> Build Main Project (F11).
When you build an EJB module as part of an enterprise application, the IDE
does the following:
- Compiles the classes to the project's build/ear-module folder.
- Places any JAR files, libraries, or directories that are on your project's
classpath and are scheduled for inclusion in deployment in the enterprise
project's build folder.
- Builds the EJB module's JAR file to the EJB module project's dist
folder and copies it to the enterprise application project's build
folder. The EJB module JAR file does not contain any of the classpath elements.
- Puts a Class-path entry in the EJB module's manifest file for all
included JAR files and puts a . entry if there is at least one directory
on the project's classpath scheduled for inclusion in deployment. This mechanism
ensures that the JAR files and directories can be used from the EJB module
even if they reside in the EAR project and not in the EJB module itself.
- Builds the enterprise application EAR file to the enterprise application
project's dist folder.
To build a stand-alone EJB module:
- Right-click the EJB module project in the Projects window and choose Build.
Or, if the EJB module project is the main project, choose Run > Build
Main Project (F11).
When you build a EJB module project as a stand-alone module, the IDE does the
following:
- Compiles the classes to the project's build/jar folder.
- Places any JAR files, libraries, or directories that are on your project's
classpath and are scheduled for inclusion in deployment into the build/jar
folder.
- Builds the EJB module's JAR file to the EJB module's dist folder.
The JAR file includes all classpath items scheduled for inclusion in deployment.
- You can mark a classpath item for inclusion in deployment in the EJB module's
Project Properties dialog box. Right-click the module's Libraries node and
choose Properties, then select the checkbox for each classpath item you want
to include in deployment.
- See Also
- Deploying an EJB Module
- Debugging an EJB Module
- Testing an EJB Module
- Adding a
Module to an Enterprise Application
- Registering a Server
Legal Notices