This chapter provides an overview of using an embeddable EJB container in Oracle WebLogic Server.
This chapter includes the following sections:
Unlike traditional Java 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 Java 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 Java 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 Java 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.
Using the Embedded EJB container with WebLogic Server requires the following:
A standard WebLogic Server installation as installed by the Oracle Universal Installer or provided by the developer Zip distribution. Use of subsets of a valid installation is not supported (for example, taking an installation and deleting selected files).
weblogic.jar
on the system classpath when running the EJB client:
$ java -classpath $CLASSPATH:$ORACLE_HOME/wlserver/server/lib/weblogic.jar
Running setWLSEnv
to set your system classpath is not required, provided that:
You need only the EJB 3.1 Lite runtime functions as outlined in EJB 3.1 Lite Functionality Supported in the Embedded EJB Container.
You do not need additional supporting functionality from the WebLogic Server distribution, such as full EJB 3.1 full support, or other WebLogic Server/Java EE 6 support beyond EJB 3.1 Lite, such as support for other WebLogic Server-related features that run in a separate process from WebLogic Server, like Node Manager and Configuration Wizard.
Tip:
During testing of the embedded EJB container, Oracle has successfully used the default allocation of 256 megabytes of Java heap memory. To do so, start the server using thejava -Xms256m
option.
However, it may be possible to run with lower memory settings, but this would depend on the nature of the application being deployed.
For more information on setting JVM parameters when starting WebLogic Server, see "weblogic.Server Configuration Options" in the Command Reference for Oracle WebLogic Server.
The EJB Lite subset of the EJB 3.1 API is supported in the Embedded EJB Container. EJB Lite is by definition a subset of functionality and doesn't describe any new feature or functionality. This section outlines the requirements of EJB Lite support as defined by the EJB 3.1 specification.
Table 7-1 represents the official requirements for EJB 3.1 Lite functionality support as defined by the EJB 3.1 specification.
Table 7-1 EJB 3.1 Functionality
Functionality | EJB 3.1 Lite | EJB 3.1 Full |
---|---|---|
Components |
||
Session Beans (stateful, stateless, singleton) |
Yes |
Yes |
Message-Driven Beans |
No |
Yes |
2.x/1.1 CMP/BMP Entity Beans |
No |
Yes |
JPA 2.0 |
Yes |
Yes |
Session Bean Client Views |
||
Local/No Interface |
Yes |
Yes |
3.0 Remote |
No |
Yes |
2.x Remote Home/Component |
No |
Yes |
JAX-WS Web Services Endpoint |
No |
Yes |
JAX-RPC Web Services Endpoint |
No |
Yes |
Services |
||
EJB Timer Service |
No |
Yes |
Asynchronous Session Bean Invocations |
No |
Yes |
Interceptors |
Yes |
Yes |
RMI-IIOP Interoperability |
No |
Yes |
Container-managed Transactions/Bean-managed Transactions |
Yes |
Yes |
Declarative and Programmatic Security |
Yes |
Yes |
Miscellaneous |
||
Embeddable API |
Yes |
Yes |