May 2017
« Sep    
Your widget title

Posts Tagged ‘Coherence*Web’

PostHeaderIcon Failed to start Service “Cluster” (ServiceState=SERVICE_STOPPED, STATE_ANNOUNCE)


I introduced an Oracle Coherence cache withing my application, which is deployed as a WAR within WebLogic  Server. In a first step, I used an instance of Oracle Coherence / Coherence Web already built in WebLogic. Then, for a couple a reasons, I detroyed the Coherence cluster. Deploying the application, the following error appeared:

java.lang.RuntimeException: Failed to start Service "Cluster" (ServiceState=SERVICE_STOPPED, STATE_ANNOUNCE)

Complete Stacktrace

java.lang.RuntimeException: Failed to start Service "Cluster" (ServiceState=SERVICE_STOPPED, STATE_ANNOUNCE)
at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.start(Service.CDB:38)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.start(Grid.CDB:38)
at com.tangosol.coherence.component.util.SafeCluster.startCluster(SafeCluster.CDB:3)

Explanation and Fix

The Coherence cluster view available in WebLogic server is a view of the Tangosol configuration, available in the files tangosol-coherence*.xml of Coherence’s JAR. To fix the issue, create a file tangosol-coherence-override.xml, in your classpath. Fill the file with a minimum content, such as:

<?xml version='1.0'?>
<!DOCTYPE coherence SYSTEM "coherence.dtd">
            <time-to-live system-property="tangosol.coherence.ttl">0</time-to-live>
            <timeout-milliseconds system-property="tangosol.coherence.guard.timeout">35000</timeout-milliseconds>
        <severity-level system-property="tangosol.coherence.log.level">5</severity-level>
        <character-limit system-property="tangosol.coherence.log.limit">0</character-limit>

Of course, you can amend and improve the file to match your requirements.
NB: in case your file is ignored by Coherence, override the property tangosol.coherence.override with value tangosol-coherence-override.xml.

PostHeaderIcon WebLogic: set a System property within a WAR


You would like to set a System property within an application packaged as a WAR.
Of course, you may modify the launching scripts of your servers, to add an option -DmyPropertyName=myPropertyValue. Sometimes, you would like to avoid such a solution, because updating the property would require an update of the setEnv.* files and therefore a action of the exploitation team.

In my case, I had to set the property tangosol.coherence.cacheconfig, which hints at the configuration file used my Oracle Coherence / Coherence*Web


The first solution is to set the property in a startup class. For more detials, consult this page: WebLogic: use a startup and/or a shutdown class in a WAR.

Another mean to handle this problematic is to create a servlet, with a code similar to:

public class JonathanBootServlet extends HttpServlet {
    private static final Logger LOGGER = Logger.getLogger(JonathanBootServlet.class);
    private static final String SVN_ID = "$Id$";

    public JonathanBootServlet() {
        if (LOGGER.isDebugEnabled()){

    public void init(ServletConfig config) throws ServletException {
        if (LOGGER.isDebugEnabled()){
            LOGGER.debug("in init()");
        System.setProperty("tangosol.coherence.cacheconfig", "jonathan-tangosol-coherence.xml");

Then add the following block in your web.xml:


Ensure this servlet is run before all others (1).

PostHeaderIcon java.lang.NoClassDefFoundError: com/tangosol/run/component/EventDeathException


You have an application which uses Oracle Coherence / Coherence*Web as cache manager. On redeploying the application, you get a stacktrace of which header is:

Exception in thread 'DistributedCache|SERVICE_STOPPED' java.lang.NoClassDefFoundError: com/tangosol/run/component/EventDeathException


Indeed, an undeploy operation stops the services of your application. But Coherence is not launched as a service among the others: it should be considered as an independant one. Therefore, you have to stop it before undeploying your application ; otherwise, your classloader is in a confused state, and loses references to classes it had loaded before, but that should now be unloaded.


You have to stop Oracle Coherence on your application shutdown.


If your application is packaged as an EAR, then create a shutdown class with the following main():

public class JonathanLalouEARShutdown extends ApplicationLifecycleListener {
   public static void main(String[] args) {

Add the following block in your weblogic-application.xml, hinting the shutdown class:

    <shutdown-class>lalou.jonathan.weblogic.JonathanLalouEARShutdown </shutdown-class>


If your application is packaged as a WAR, then create a class implementing ServletContextListener, and add the following block in your web.xml:


The detailed procedure is described at this link: WebLogic: use a startup and/or a shutdown class in a WAR

PostHeaderIcon WebLogic: Unresolved Webapp Library references for … coherence-web-spi


I have to integrate Oracle Coherence, or more accurately Coherence*Web, within an application deployed as a WAR in WebLogic 10.3.
Since Oracle bought both BEA and Tangosol, increasing their integration, using Coherence jars implicitely is allowed. Anyway I decided to add the following block in weblogic.xml


Then I get this error:

Caused By: Error: Unresolved Webapp Library references for
""ServletContext@25681165[app:risklayer-web module:jonathan-lalou.war path:/jonathan-lalou spec-version:null]"", defined in weblogic.xml [Extension-Name: coherence-web-spi, Specification-Version: 1, Implementation-Version:, exact-match: false]


Indeed, I had to deploy Coherence*Web WAR in WebLogic, in the console:
Deployments > Install > select Coherence WAR, eg: C:\jonathan\bea\coherence_3.5\lib\coherence-web-spi.war > Next> Install this deployment as a library > Next > Target your server > Finish