Failed to start Service “Cluster” (ServiceState=SERVICE_STOPPED, STATE_ANNOUNCE)
Case
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.net.Cluster.onStart(Cluster.CDB:366) at com.tangosol.coherence.component.net.Cluster.start(Cluster.CDB:11) 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"> <coherence> <cluster-config> <multicast-listener> <time-to-live system-property="tangosol.coherence.ttl">0</time-to-live> <join-timeout-milliseconds>3000</join-timeout-milliseconds> </multicast-listener> <unicast-listener> <address>127.0.0.1</address> <port>8088</port> <port-auto-adjust>true</port-auto-adjust> <priority>8</priority> </unicast-listener> <packet-publisher> <packet-delivery> <timeout-milliseconds>30000</timeout-milliseconds> </packet-delivery> </packet-publisher> <service-guardian> <timeout-milliseconds system-property="tangosol.coherence.guard.timeout">35000</timeout-milliseconds> </service-guardian> </cluster-config> <logging-config> <severity-level system-property="tangosol.coherence.log.level">5</severity-level> <character-limit system-property="tangosol.coherence.log.limit">0</character-limit> </logging-config> </coherence>
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
.