Oracle® Enterprise Pack for Eclipse User's Guide
  Go To Table Of Contents


12 Coherence Support

Coherence provides replicated and distributed (partitioned) data management and caching services on top of a peer-to-peer clustering protocol.

OEPE provides support for Oracle Coherence. For more information, see the Coherence information, which is available on Oracle Technology Network at

This document contains the following sections:

12.1 Coherence Tooling: Configuring Projects for Coherence

This section describes how to work with Coherence facets.

12.1.1 Configuring Coherence Facet

Use the context menu and the properties dialog to add and configure your facets.

To configure your project for Coherence:

  1. If you didn't add the Coherence facet when you create a project, you can add the facet to an existing project by right-clicking your project in the Project Explorer and selecting Properties from the drop-down menu. This opens the Properties dialog.

  2. In the Properties dialog, select Project Facets on the left panel, and then select Oracle Coherence from the Project Facet list.

    Click Further configuration required to open the Modify Faceted Project > Coherence dialog.

    If the Coherence library is listed as a user library, proceed as follows:

    • Select the Coherence library from the list.

    • Accept default settings.

    • Click OK.

    If you are using Oracle WebLogic Server 12c (12.1.2) runtime, Coherence might already be installed on your machine if you chose this option when you installed. In this case, the Coherence Library in Fusion Middleware Install option is available in the Library > Type list.

    If the Coherence library is not listed, you need to either point to an existing installation, or download the library.

    To point to an already downloaded Oracle Coherence library:

    1. Click Manage User Library to open the Preferences > User Libraries dialog.

    2. Select a Java user library in the form of the coherence.jar, which represents the entire library.

      Note that the Coherence JAR files reside in the \coherence\lib directory of the Oracle Coherence installation. Also note that the same dialog allows you to fine tune your Coherence library configuration.

    3. To obtain the Coherence library, click Download Library. This opens the Download Library dialog.

  3. Click OK on the Modify Faceted Project > Coherence dialog.

  4. Click Apply > OK to complete the configuration.

12.1.2 Editing Coherence Launch Configuration

The Coherence launch configuration editor sets the most commonly used Coherence command line arguments.

To modify the Coherence launch configuration for your project configured with the Coherence facet:

  1. Right-click your project in the Project Explorer, and then select Run As > Run Configurations from the drop-down menu to open the Run Configurations dialog.

  2. Select Coherence Launch Configuration from the list. The right pane of the Run Configurations dialog displays instructions on how to use this dialog to configure Coherence launch settings. You follow these instructions by right-clicking the configuration node on the left pane and making an appropriate choice.

  3. When a new configuration is created and selected, you can edit settings from the right pane as follows:

    • On the Main tab, define your project and its main class. Note that the Project and Main class fields are populated with default values and cannot be left empty.

    • On the Coherence tab, define all the general, XML, and other system properties:

      • The General subtab lets you define properties related to topology, logging, and network configurations.

      • The XML subtab lets you set the management type (such as local or remote), as well as configure JMX RMI, HTTP, and the refresh options.

      • The Other subtab lets you set a variety of properties.

      The Coherence launch configuration is populated with default settings from the tangosol-coherence.xml file in the coherence.jar file merged with the tangosol-coherence-override.xml file currently in the classpath, and, finally, with the VM arguments.

    • Complete the remaining tabs of the Run Configurations dialog.

    • Click Apply > Run on the Run Configurations dialog to complete the procedure. The Console view will display the Coherence run output.

The created Coherence XML files, such as coherence-cache-config.xml, pof-config.xml, and tangosol-coherence-override.xml, reside in your project's src directory.

12.1.3 Editing Coherence Operational Configuration

OEPE provides an editor that you can use to modify the generated tangosol-coherence-override.xml Oracle Coherence deployment descriptor.

To modify operational configuration elements defined in the tangosol-coherence-override.xml file:

  1. In the Project Explorer, right-click src/tangosol-coherence-override.xml, and select Open With > Coherence Override to open the Coherence Override editor.

  2. In the editor, select the following settings to modify:

    • Cluster

    • Logging

    • Configurable Cache Factory

    • Management

    • Security

For information on Oracle Coherence operational configuration deployment descriptors and their elements, see "Operational Configuration Elements" in Developing Applications with Oracle Coherence.

12.1.4 Editing Coherence Cache Configuration

OEPE provides an editor that you can use to modify the generated coherence-cache-config.xml Oracle Coherence deployment descriptor.

To modify cache configuration elements defined in the coherence-cache-config.xml file:

  1. In the Project Explorer, right-click coherence-cache-config.xml, and select Open With > Coherence Cache Configuration to open the Coherence Cache Configuration editor.

  2. In the Coherence Cache Configuration editor, you can modify the following settings:

    • General

    • Cache Scheme Mappings

    • Caching Schemes

For more information on Oracle Coherence cache configuration elements, see "Cache Configuration Elements" in Developing Applications with Oracle Coherence.

12.2 Working with Coherence (GAR) Applications

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

12.2.1 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 12.1.2.

    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.


      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 Developing Applications with Oracle Coherence.

12.2.2 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.

12.2.3 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.


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

12.2.4 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.


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