Enterprise JavaBeans (EJB) are reusable Java components that implement business logic and enable you to develop component-based distributed business applications. EJBs reside in an EJB container, which provides a standard set of services such as persistence, security, transactions, and concurrency. Enterprise JavaBeans are the standard for defining server-side components. WebLogic Server's implementation of the Enterprise JavaBeans component architecture is based on Sun Microsystems EJB specification.
The EJB specification defines the following four types of Enterprise JavaBeans:
Stateless session. These non-persistent EJBs provide a service without storing an interaction or conversation state between methods.
Stateful session. These non-persistent EJBs maintain state across methods and transactions. Each instance is associated with a particular client.
Entity. These persistent EJBs represent an object view of the data, usually rows in a database. An entity bean has a primary key as a unique identifier.
Message-driven. These EJBs are integrated with the Java Message Service (JMS) to enable message-driven beans to act as a standard JMS message consumer and perform asynchronous processing between the server and the JMS message producer. The WebLogic Server container directly interacts with a message-driven bean by creating bean instances and passing JMS messages to those instances as necessary.
From the EJB sub-node, of the Deployments node of the Administration Console, you can update or configure EJBs deployed on WebLogic Server or monitor the their performance.
Tasks
Configuring EJBs
To configure an EJB for deployment to the WebLogic Server Administration Console:
Start the WebLogic Server Administration Console.
Select the Domain in which you will be working.
In the left pane of the Console, click Deployments.
In the left pane of the Console, click EJB. A table is displayed in the right pane of the Console showing all the deployed EJBs.
Select the Configure a new EJB option.
Locate the EAR, WAR or JAR file you would like to configure. You can also configure an exploded application or component directory. Note that WebLogic Server will deploy all components it finds in and below the specified directory.
Click [select] to the left of a directory or file to choose it and proceed to the next step.
Select a Target Server from among Available Servers.
Enter a name for the EJB or application in the provided field.
Click Configure and Deploy. The Console will display the Deploy panel, which lists deployment status and deployment activities for the EJB.
Using the available tabs, enter the following information:
Configuration—Edit the staging mode and enter the deployment order.
Targets—Indicate the Targets-Server for this configured EJB or application by moving the server from the Available list to the Chosen list.
Deploy—Deploy the EJB or application to all or selected targets or undeploy it from all or selected targets.
Monitoring—Enable session monitoring for the EJB or application.
Notes—Enter notes related to the EJB or application.
Installing New EJBs
Start the WebLogic Server Administration Console.
Select the Domain in which you will be working.
In the left pane of the Console, click Deployments.
In the left pane of the Console, click EJB. A table displays in the right pane of the Console showing all the deployed EJBs.
Select the Configure a new EJB option.
Locate the EAR, WAR or JAR file you would like to configure. You can also configure an exploded application or component directory. Note that WebLogic Server will deploy all components it finds in and below the specified directory.
Click [select] to the left of a directory or file to choose desired file and proceed to the next step.
Select a Target Server from among Available Servers.
Enter a name for the EJB or application in the provided field.
Click Configure and Deploy to install the EJB or application. The Console will display the Deploy panel, which lists deployment status and deployment activities for the EJB.
Using the available tabs, enter the following information:
Configuration—Edit the staging mode and enter the deployment order.
Targets—Indicate the Targets-Server for this configured EJB or application by moving the server from the Available list to the Chosen list.
Deploy—Deploy the EJB or application to all or selected targets or undeploy it from all or selected targets.
Monitoring—Enable session monitoring for the EJB or application.
Notes—Enter notes related to the EJB or application.
Configuring EJB General Options
Click the Deployments node in the left pane and then choose the EJB sub-node. A list of EJBs deployed on your domain displays under EJB and in the right pane.
Click the Configure a New EJB option in the right pane to create a new EJB or choose an existing EJB from the list to modifying its existing configuration. The EJB Deployments page displays in the right pane.
Select the Configuration tab.
Select the General tab.
Enter the name of the EJB.
Enter the path to be used for this component.
Enter the deployment for this component.
Check the box to indicate whether the component is to be deployed on the target.
Click Create to configure the General options or Apply to modify options already specified for an existing EJB component.
Configuring EJBC Options
Click the Deployments node in the left pane and then choose the EJB sub-node. A list of EJBs deployed on your domain displays under EJB and in the right pane.
Click the Configure a New EJB option in the right pane to create a new EJB or choose an existing EJB from the list to modifying its existing configuration. The EJB Deployments page displays in the right pane.
Select the Configuration tab.
Select the EJBC Options tab.
Enter the Java compiler to be used for the component.
Enter the path used for this component.
Enter any extra RMIC options to be used.
Check the box to enables or disables the ability to keep generated source files
Click Create to configure the EJBC Options or Apply to modify options already specified for an existing EJB component.
Setting the EJB's Target Server
Click the Deployments node in the left pane and then choose the EJB sub-node. A list of EJBs deployed on your domain displays under EJB and in the right pane.
Click the Configure a New EJB option in the right pane to create a new EJB or choose an existing EJB from the list to modifying its existing configuration. The EJB Deployments page displays in the right pane.
Before setting the target server, configure new EJBs using instructions in Configuring EJBs.
Click the Targets tab in the right pane.
Click the Servers tab.
Click the arrow to move the name of the target server from the Available box to the Chosen box.
Click Apply.
Setting the EJB's Target Cluster
Click the Deployments node in the left pane and then choose the EJB sub-node. A list of EJBs deployed on your domain displays under EJB and in the right pane.
Click the Configure a New EJB option in the right pane to create a new EJB or choose an existing EJB from the list to modifying its existing configuration. The EJB Deployments page displays in the right pane.
Before setting the target cluster, configure new EJBs using instructions in Configuring EJBs.
Click the Targets tab in the right pane.
Click the Clusters tab.
Click the arrow to move the name of the target cluster from the Available box to the Chosen box.
Click Apply.
Monitoring Stateless Session EJBs
To monitor applications containing stateless session EJBs:
Click the Deployments node in the left pane and then choose the EJB sub-node. A list of EJBs deployed on your domain displays under EJB and in the right pane.
Click the name of the deployed EJB or application that you want to monitor. The EJB Deployment page displays in the right pane.
Click the Monitoring tab.
Click Monitoring All Stateless EJBRuntimes for the application that you want to monitors. A table listing all stateless session EJBs in the application displays in the right pane.
View the statistics for each stateless session EJBs.
Monitoring Stateful Session EJBs
To monitor applications containing stateful session EJBs:
Click the Deployments node in the left pane and then choose the EJB sub-node. A list of EJBs deployed on your domain displays under EJB and in the right pane.
Click the name of the deployed EJB or application that you want to monitor. The EJB Deployment page displays in the right pane.
Click the Monitoring tab.
Click Monitoring All Stateful EJBRuntimes for the application that you want to monitors. A table listing all stateful session EJBs in the application displays in the right pane.
View the statistics for each stateful session EJBs.
Monitoring Entity EJBs
To monitor applications containing entity EJBs:
Click the Deployments node in the left pane and then choose the EJB sub-node. A list of EJBs deployed on your domain displays under EJB and in the right pane.
Click the name of the deployed EJB or application that you want to monitor. The EJB Deployment page displays in the right pane.
Click the Monitoring tab.
Click Monitoring All Entity EJBRuntimes for the application that you want to monitors. A table listing all entity EJBs in the application displays in the right pane.
View the statistics for each entity EJBs.
Monitoring Message-Driven EJBs
To monitor applications containing message-driven EJBs:
Click the Deployments node in the left pane and then choose the EJB sub-node. A list of EJBs deployed on your domain displays under EJB and in the right pane.
Click the name of the deployed EJB or application that you want to monitor. The EJB Deployment page displays in the right pane.
Click the Monitoring tab.
Click Monitoring All Message Driven EJBRuntimes for the application that you want to monitors. A table listing all message-driven EJBs in the application displays in the right pane.
View the statistics for each message-driven EJBs.
Deploying EJBs
Expand the Deployments node in the left pane.
Right-click on the EJB node.
Select Configure a new EJB.
Locate the .war file you would like to configure. You can also configure an exploded application or component directory. Click [select] to the left of a directory or file to choose it and proceed to the next step.
Select a Target Server from among Available Servers.
Enter a name for the EJB or application in the provided field.
Click Configure and Deploy. The Console will display the Deploy panel, which lists deployment status and deployment activities for the EJB or application.
Use the Deploy button to deploy the application to all or selected targets or undeploy it from all or selected targets.
Deploying EJBs to a Target Server
Click the Servers node in the left pane.
Click the server instance to which you want to deploy the EJBs. The Servers page for the selected server instance displays in the right pane.
Click the Deployments tab.
Click the EJB tab.
Chose the EJBs for this server instance by moving the deployment units from the Available box to the Chosen box.
Click Apply
UnDeploying EJBs
Click the name of the EJB or application you want to undeploy from the list of EJBs in the left pane.
Click the Targets tab in the right pane.
Click the Servers tab.
Click the arrow to move the name of the target server from the Chosen box to the Available box.
Click Apply to undeploy the EJB or application.
Adding or Editing EJB Deployment Notes
Click the Deployments node in the left pane and then choose the EJB sub-node. A list of EJBs deployed on your domain displays under EJB and in the right pane.
Click the name of the deployed EJB or application for which you want to add notes. The EJB Deployment page displays in the right pane.
Click the Notes tab.
Add or edit the optional information in the Notes scroll box.
Click the Create button to enter the information or the Apply button to update the information.