DevPortal

How do I prepare and deploy EJB applications?


Table of Contents


How do I prepare and deploy EJB applications?

EJB applications include EJB components like session beans, entity beans and MDB’s. EJB applications are deployed on Pramati EJB Container. Pramati Server supports deployment of both EJB 1.1 and 2.0 beans.

If EJB applications contain stateless, stateful, and Bean Managed Persistence (BMP) beans compliant to EJB 1.1 standards, they are automatically migrated to EJB 2.1 at the time of deployment.

This section discusses how to implement, assemble, deploy, and invoke EJB applications that are deployed on Pramati Server.

How do I package EJB applications?

EJB applications can be packaged as .jar or .ear files.

How do I deploy EJB applications?

Deploying EJB applications refers to making beans available to clients. EJB applications can be deployed on Pramati Server as either standard .jar or .ear files. To get an application to a ready-to-deploy state, you need to resolve EJB information with regard to Server environment such as resource references, resource environment references, concurrency, and security role references.

How do I configure Bean Properties?

The bean properties node facilitates specifying the properties of each bean. To set the bean properties using the Deploy Tool, click the bean properties node in the node tree to set the properties for each bean. This opens a panel on the right, which displays a table listing all the beans in the application with their properties.

Depending on the selected application, the attributes that can be set here are general properties, EJBs, resources, resource environment, sessions, bean pools, run as security information, JNDI name, and MDB destinations.

How do I configure General Properties?

The General properties panel appears by default when you click the Bean Properties node. The panel displays the following attributes: Note: No JNDI names are provided for MDBs as they do not have a client view.

How do I configure EJB?

This panel is displayed when you click the EJB tab in the Bean Properties node. This panel lists the beans which refer other beans in the container. The attributes provided in this tab are:

Selecting any of the beans row displays the EJB reference type, the interfaces of the bean such as LocalHome or RemoteHome and also an optional description in the panel.

How do I configure Resources?

Clicking the Resource tab facilitates mapping of resource references onto the resources defined on the server. In case a new resource is added using the Management Console, it gets added to the running Server.

The attributes in this panel are:

Selecting a row displays the resource type, the resource authorization, and an optional description in the lower half of the panel.

How do I configure Resource Environment?

Click the Resource Environment tab in the Bean Properties node. It displays details of an enterprise bean that refers to an administered object. This object is associated to a resource in the bean’s environment.

The panel contains the resource environment reference name, the resource environment reference type expected by the enterprise bean code, the bean name, and the archive which the bean belongs to. For JMS, the resource environment reference can be selected from the types javax.jms.Queue and javax.jms.Topic. The drop-down list displays only the objects of resource environment type.

The deployer can select the value assigned to the bean's resource environment reference.

How do I configure Sessions?

The Session tab displays the following attributes:

After the specified time, if the actual usage of bean instances is below the minimum pool size, the pool size is automatically reduced to the minimum pool size. This provides an optimized use of bean pool.

How do I configure Bean Pool Properties?

The Bean Pool tab displays the following attributes:

How do I configure Environment Properties?

All the environment entries that can be accessed from the EJB code are displayed here. An environment entry is scoped to the bean. This means:

The following fields are displayed in the Environment Properties panel:

What is an EJB Environment?

Table 1: EJB Environment properties
FieldsDescription
JarThe Java archive name is displayed here. This field is not editable.
BeanThe bean name is displayed in this field. This field is not editable.
Entry NameName of the environment entry.
TypeThe Java type of environment entry.
ValueThe value assigned for the environment entry. This field is editable.

What is a Web Environment?

Table 2: Web environment properties
FieldsDescription
WarThe Web archive name is displayed here. This field is not editable.
BeanThe bean name is displayed in this field. This field is not editable.
Entry NameName of the environment entry.
TypeJava type of environment entry.
ValueThe value assigned for the environment entry. This field is editable.

How do I configure Security Role References?

The Security related views are available only if the selected application contains references to Security.

Click Security node in the Deploy Tool to bring up the Security panel. This enables assigning of realm roles to the security roles defined in the .jars. The available realm roles are obtained from the Security service started by the Server.

The attributes in this panel are:

Table 3: Attributes of Security Role References

FieldsDescription
RealmThis specifies the realm name. Select from the available realms in the drop-down list.
ModuleThis displays the JAR name, or the application level role name in the security role.
Role NameThis field displays all role names that have been already defined for the application. The management console may be used to define the security roles.
Role LinkSelect from the role links available in the drop-down list whose value is the name of the security role.

Note: If there is a problem in obtaining the security service from the Server, check the log and Status window in the Management Console.

What is 'Run As Roles'?

Select the Run As tab in the Bean Properties node. The deployer uses this to map a user to the Run As role for a bean. The panel displays the following attributes:

Note: This panel appears only if Security Roles have been added.

How do I view deployed EJBs?

All configured server instances on the local machine are displayed under the nodes directory in the server installation directory. This directory also provides references that can be used for viewing deployed applications on these servers.

Deploying a jar or ear on Server creates the following directory structure:

Undeploying the application removes the above files from their respective locations.


© Pramati Technologies 2007 Runs on Pramati Server | Feedback | Legal