In this example, you can deploy a sample application named
dizzyworld.ear to the Managed Servers in the
This chapter discusses how to deploy the sample application to a single cluster (
Dept1_Cluster1). You can choose to deploy the whole application in a single cluster or its different tiers in multiple clusters. In addition, you can deploy a separate application to a separate cluster within the same domain, based on your specific deployment and management requirements.
This chapter discusses the following topics:
To download and extract the sample application, do the following:
dizzyworld.ear file from the following URL:
If this file is downloaded as
dizzyworld.zip in your web browser, manually rename its file name to
Copy the dizzyworld.ear file to a local directory in
If you are deploying this sample application for testing purposes, you do not need to perform server migration.
With this configuration, or if you want only one application to use Coherence caches, each deployed Web application becomes its own Coherence cluster. Caches will be visible to the individual modules only. For example, this could be a recommended deployment for a stand-alone WAR deployment or stand-alone EJB deployment.
If you are deploying multiple WAR files, note that this configuration produces the largest number of Coherence nodes in the cluster—one for each deployed WAR file that uses
coherence.jar. It also results in the largest resource utilization of the three configurations—one copy of the Coherence classes are loaded for each deployed WAR. On the other hand, since each deployed Web application is its own cluster, Web applications are completely isolated from other potentially misbehaving Web applications.
A Web module within an EAR can have a module-scoped Coherence node but an EJB module within an EAR can only have an application-scoped Coherence node.
Use the WebLogic Server Administration Console to deploy
active-cache.jar as shared libraries to all of the target servers where the application will be deployed. See "Install a Java EE Library" in the Oracle Fusion Middleware Oracle WebLogic Server Administration Console Help.
As an alternative to the Administration Console, you can also deploy the JAR files on the command line. The following are sample deployment commands:
java weblogic.Deployer -username <> -password <> -adminurl <> -deploy coherence.jar -name coherence -library -targets <> java weblogic.Deployer -username <> -password <> -adminurl <> -deploy active-cache.jar -name active-cache -library -targets <>
active-cache.jar as optional packages in the
manifest.mf file of each module that will be using Coherence.
As an alternative to using the manifest file, copy
active-cache.jar to each WAR file's
Example 8-1 illustrates the contents of a sample
(Optional) If you want to configure Coherence cluster properties, create a
CoherenceClusterSystemResourceMBean and reference it as a
coherence-cluster-ref element in
Example 8-2 illustrates a sample configuration for WAR-scoped clusters in the
weblogic.xml file. The
myCoherenceCluster MBean is of type
For this enterprise deployment topology, you must install and deploy the
dizzyworld.ear web application to Managed Servers in
Dept1_Cluster1. To do so, compete the following steps:
Extract the dizzyworld.ear file to a local directory in
weblogic-application.xml (located at
/u01/app/FMW_Product1/Oracle/Middleware/wlserver_10.3/server/lib/consoleapp/META-INF) in a text editor and enter your Oracle Coherence cluster name, as shown in the following example:
Save the file after making changes.
Log in to the WebLogic Administration Console.
If you have not already done so, in the Change Center of the Administration Console, click Lock & Edit.
In the left pane of the console, select Deployments.
The Summary of Deployments page is displayed.
In the right pane, click Install.
The Install Application Assistant page is displayed.
Specify the path, where your
dizzyworld.ear file is located, and click Next.
Select Install this deployment as an application and click Next.
Select Dept1_Cluster1, and then All servers in the cluster (Figure 8-1).
In the Optional Settings page, accept the default values, and Click Next.
Review the configuration settings you have chosen, and select No, I will review the configuration later to immediately update the application's configuration after you install it. Then click Finish to complete the installation.
To start the Web application:
In the left pane of the Administration Console, select Deployments.
In the right pane, select the check boxes next to dizzyworld.ear.
Click Start and choose Servicing all requests to the Web application.
Click Yes to confirm that you want to start the selected Web application.
After starting the web application, test the application as follows:
Add a few items to the shopping cart using the
go shopping link.
Verify that your shopping cart includes the items you selected. If the items are in your shopping cart, the application is working fine.