Working with Coherence (GAR) Applications

This section describes how to create Coherence applications, export them, deploy them, and locate deployed Coherence applications.

Creating Coherence Applications

With the release of WebLogic 12.1.2, Eclipse now supports the GAR (GridArchive) mechanism, a new packaging mechanism for Coherence cache configurations and classes.

You can create a new Coherence application using the Oracle Coherence Application wizard. The wizard creates a Coherence GAR project and gives you to option to add it to a J2EE EAR project.

To create a Coherence Application:

  1. Choose File > New > Other > Oracle > Coherence > Oracle Coherence Application. The Oracle Coherence Application dialog appears.

    1. Enter the project name. The project name is the name of the GAR project module in the application. The project name you enter here will be the name of the application. If you choose to add the project to the EAR, the EAR name will be generated based on the GAR project name.

    2. Select your target runtime and server configuration details. The Coherence application requires that you use the Oracle WebLogic Server 12c.

    3. Check to add the GAR project to the EAR. If you choose to add the GAR project module to EAR, a reference of the GAR module will be added to weblogic-application.xml in the EAR. Adding the project to the EAR allows the GAR module access to resources defined in the EAR, as well as other J2EE modules such as WAR and EJB.

      Note: Only one GAR module can exist in an EAR project. Only Coherence configuration and classes can be included in GAR. No EJBs are allowed in GAR.

    4. Check to add the project to working sets. Working sets help you contextually organize resources across projects. Working sets are a subset of files/classes/folders/projects and represent development workflows.

  2. Click Next. The Java Configure project for building a Java application dialog appears. Add or edit the source path.

  3. Click Next. The Coherence library configuration page appears. You have the option to change the Coherence library type to a user library, by specifying an Eclipse User Library containing the coherence.jar. Specifying the user library compiles the GAR project against the user library, instead of against the JARs from the WebLogic server, or Fusion Middleware installation. You can also select which default Coherence configuration files to create. When configuration files are created as part of the GAR, files such as coherence-cache-config.xml and pof-config.xml are placed in the root directory. For an overview of the Coherence default configuration files, see the Oracle Coherence Developer's Guide.

Exporting a Coherence Application

You can export your Coherence project as either an EAR or a GAR file using the right-click context menu.

To export a Coherence Application:

  1. Select your Coherence or EAR project node.

  2. Right-click and select Export. The Export dialog appears.

  3. Select an export destination and click Next.

  4. Complete the destination details and click Finish.

Deploying a Coherence Application

You can deploy your Coherence application to a WebLogic server directly from OEPE, or you can export the application in an EAR or GAR and then deploy it to the WebLogic server with the Admin console, WLST, and weblogic.Deployer.

To deploy a Coherence Application:

  1. Select your Coherence GAR or EAR project node.

  2. Right-click and select Run As > Run On Server. The Run On Server dialog appears.

  3. Select your server. Click Next.

  4. Add or remove projects. Click Finish.

  5. Once deployed successfully to the WebLogic server, the GAR application can be found under WLS server instance in the Servers View, under the Published Module node.

Note: Standalone GAR projects (not part of an EAR) require changing WLS Server publishing mode to the Exploded Archive Mode, in the server properties page.

Locating Your Deployed Coherence Application

To locate your deployed Coherence Application:

  1. Select the WebLogic server instance in the servers view.

  2. Expand the Published Modules, under the WebLogic server and locate the newly deployed Coherence application.

    Or

    Select the WebLogic server, right click and select Goto > Admin Console and locate the Coherence application.