Network Deployment (Distributed operating systems), v8.0 > Develop and deploying applications > Develop EJB applications > Develop applications using the embeddable EJB container


Run an embeddable container

Use this task to run an embeddable container. Applications running in the embeddable container start faster and require a smaller footprint than when running in the full application server. It is an ideal environment for quickly developing and testing applications that might eventually run in the application server.

Before running an embeddable container, have the following items ready:

New feature: Beginning in WAS v8.0 you can configure the server to use the High Performance Extensible Logging (HPEL) log and trace infrastructure instead of using SystemOut.log , SystemErr.log, trace.log, and activity.log files or native z/OS logging facilities. If you are using HPEL, you can access all of your log and trace information using the LogViewer command-line tool from your server profile bin directory. See the information about using HPEL to troubleshoot applications for more information on using HPEL.New feature:

The key to running the embeddable container is the class path. The class path must include all the artifacts previously listed. For example, if the main class is my.pkg.MyMainClass, and it uses enterprise beans that are stored in the MyEJBModule.jar file, the following line might run the main class that launches the embeddable container. This example assumes that all JAR files and class directories are in the current working directory.

It is possible to run the embeddable container without specifying all the modules on the class path. This requires the code to specify a File or File array for the MODULES property, and the context class loader for the thread creating the container instance must be able to load the specified files.

To specify embeddable container properties in a text file other than embeddable.properties in the current working directory, then specify the com.ibm.websphere.embeddable.configFileName system property; for example:

When developing an application using JPA in the embeddable EJB container, the class path must include the JPA thin client, com.ibm.ws.jpa.thinclient_n.0.0.jar, where n is the WAS release; for example, 8 for V8. The JPA thin client is located in \runtimes where the root directory of the installation image is located.

We can specify the Java agent mechanism to complete the dynamic enhancement at run time. For example, type the following line of code at the command prompt:

To enable tracing in the embeddable container, you can specify the com.ibm.ejs.ras.lite.traceSpecification system property to a trace specification value as you would specify for the server. By default, the trace is printed to standard output, but you can redirect the output by specifying the com.ibm.ejs.ras.lite.traceFileName system property. The following example shows how you can use both system properties:

If your beans use the javax.annotation.Resource annotation with the lookup attribute, also use the Java Endorsed Standards Override Mechanism to override the javax.annotation.Resource API that is available in the JDK on the system. Copy the WAS_HOME\runtimes\endorsed\endorsed_apis_8.0.0.jar file into a target directory of your choice. Use the java.endorsed.dirs property on the Java command to specify your directory that contains the copied JAR file. The following example shows how you can specify the java.endorsed.dirs property:


Trace user interface for stand-alone clients
Develop applications using the embeddable EJB container
Use bean validation in the product

+

Search Tips   |   Advanced Search