Search
Calendar
January 2018
S M T W T F S
« Sep    
 123456
78910111213
14151617181920
21222324252627
28293031  
Your widget title
Archives

Posts Tagged ‘Oracle Coherence’

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

Case

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

Explanation

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.

Fix

You have to stop Oracle Coherence on your application shutdown.

EAR

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) {
   CacheFactory.shutdown();
   }
}

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

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

WAR

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

<listener>
    <listener-class>your.class.implementing.ServletContextListener</listener-class>
</listener>

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

Case

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

    <library-ref>
        <library-name>coherence-web-spi</library-name>
        <specification-version>1.0.0.0</specification-version>
        <implementation-version>1.0.0.0</implementation-version>
        <exact-match>false</exact-match>
    </library-ref>

Then I get this error:

Caused By: weblogic.management.DeploymentException: 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: 1.0.0.0, exact-match: false]

Fix

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