EJB modules

Enterprise Java™ bean (EJB) modules are used to assemble one or more enterprise beans into a single deployable unit. An EJB module is stored in a standard Java archive (JAR) file.

Overview

An EJB module can be used as a standalone module, or it can be combined with other modules to create an enterprise module. An EJB module is installed and run in an enterprise bean container.

An EJB module has the following characteristics:

  • It contains one or more deployable enterprise beans.
  • Optional (in EJB 3.x): It might contain a deployment descriptor, stored in an Extensible Markup Language (XML) file. This file declares the contents of the module, defines the structure and external dependencies of the beans in the module, and describes how the enterprise beans are to be used at run time.
  • It targets one of the these servers:
    • IBM® WebSphere® Application Server traditional or Liberty version 8.5.
    • IBM WebSphere Application Server traditional version 8.0.
    • IBM WebSphere Application Server traditional version 7.0, which is already enabled with EJB 3.0 support.

When you create a new EJB project in an enterprise archive (EAR) file, an EJB client project is created by default. EJB client projects allow flexible packaging of the EJB interface classes for use with local and remote client applications.

Note: EJB modules that contain EJB 3.x beans must be at the EJB 3.x facet level when running on the product. To set the EJB module to support EJB 3.x beans, you can set the EJB version in the project facet to 3.x, or you can make sure that the module does not contain an ejb-jar.xml deployment descriptor. If the module level is EJB 2.1 or earlier, no EJB 3.x functions, including annotation scanning or resource injection, is performed at runtime.

[8.5.5.9 or later]To deploy an EJB module to WebSphere Application Server traditional, install WebSphere EJB (Extended) facet in your EJB project. The WebSphere EJB (Extended) facet requires Java 1.8 or earlier.

Deployment

You can deploy an EJB module as a stand-alone application, or combine it with other EJB modules or with Web modules to create a Java application. An EJB module is installed and run in an enterprise bean container.

  • An EJB project must be referenced by an enterprise module project (defined as a module in an EAR file) in order to be deployed successfully and run on a server.
  • [8.5.5.6 or later]Liberty servers can deploy standalone EJB modules.
Icon that indicates the type of topic Concept topic
Timestamp icon Last updated: July 17, 2017 21:58

File name: cejbmodules.html