6 Using an Embedded EJB Container in Oracle WebLogic Server
This chapter includes the following sections:
Overview of the Embeddable EJB Container
Unlike traditional Jakarta EE server-based execution, embeddable container usage allows client code and its corresponding enterprise beans to run in a Java SE environment without having to deploy them to a Jakarta EE server. This provides better support for testing, offline processing (e.g., batch jobs), and the use of the EJB programming model in desktop applications.
Most of the services present in the enterprise bean container in a Jakarta EE server are available in the embedded enterprise bean container, including injection, container-managed transactions, and security. Enterprise bean components execute similarly in both embedded and Jakarta EE environments, and therefore the same enterprise bean can be easily reused in both standalone and networked applications.
For a detailed example of using the Embedded EJB container in a Java SE environment, see EJB 3.1: Example of Using the Embeddable EJB Container in Java SE.
EJB Lite Functionality Supported in the Embedded EJB Container
WebLogic Server's embeddable enterprise bean container implements the Enterprise Beans Lite feature group defined by Jakarta Enterprise Beans 4.0. Enterprise Beans Lite is a subset of the Enterprise Beans API, not a separate product or API. An embeddable container is an optional Enterprise Beans 4.0 feature. When provided, it must support the Lite group.
**INTERNAL XREF ERROR** represents the official requirements for EJB Lite functionality support as defined by the EJB 3.2 specification.
The third column reports the API-group classification in the Jakarta Enterprise Beans 4.0 specification; it is not a statement of Jakarta EE 11 platform requirements. Jakarta EE 11 removed the Enterprise Beans 2.x API group and Jakarta XML Web Services from the platform. Jakarta EE 10 had already removed entity beans and the embeddable Enterprise Beans Container from the platform.
For WebLogic-specific support, the embeddable provider documented by this chapter implements the Lite group. Separately, WebLogic Server ships a Jakarta XML Web Services 4.0 stack and retains its documented compatibility features. Jakarta Persistence is a separate specification rather than an Enterprise Beans Lite feature.
WebLogic Server supplies Jakarta Persistence 3.2 with EclipseLink 5.0.1 as its default provider.
Table 6-1 Requirements for EJB Lite vs. EJB 3.2 Full
| Feature group | Enterprise Beans Lite member? | Enterprise Beans 4.0 specification API group |
|---|---|---|
| Stateful, stateless, and singleton session beans | Yes | Required by the full EJB API |
| Local business interface and no-interface view | Yes | Required by the full EJB API |
| Container-managed and bean-managed transactions | Yes | Required by the full EJB API |
| Declarative and programmatic security | Yes | Required by the full EJB API |
| Interceptors | Yes | Required by the full EJB API |
| Local asynchronous session bean invocations | Yes | Required by the full EJB API |
| Non-persistent Enterprise Beans Timer Service | Yes | Required by the full EJB API |
| Message-driven beans | No | Required by the full EJB API |
| Enterprise Beans 3.x remote business view | No | Required by the full EJB API |
| Persistent Enterprise Beans Timer Service | No | Required by the full EJB API |
| Jakarta XML Web Services endpoints | No | Required by the full EJB API |
| Enterprise Beans 2.x API | No | Optional API group |
| 2.x/1.x CMP/BMP entity beans and Enterprise Beans QL | No | Optional API group |
| Embeddable Enterprise Beans Container | Not a Lite member; its provider must implement Lite | Optional API group |