Thursday, 7 July 2011

Starting a Coherence Server From WLS 10.3.4 Console

Decided it might make sense to use Node Manager to stop/start my stand alone coherence servers which will be accessed by the WebLogic managed server instances as storage disabled members. The process is pretty straight forward and is shown in this blog entry below. However there is one thing to be aware of.

http://blogs.oracle.com/jamesbayer/entry/weblogic_server_1034_screencas

In my example I wanted to use Coherence 3.7 and so to do that I needed to add the following to the "Server Start" Classpath field

/u01/Middleware/coherence/370/coherence/lib/coherence.jar

Once I did that and tried to start the Coherence Server from the admin console , using node manager it failed with an error as follows.

Jul 8, 2011 4:36:25 AM> <INFO> <NodeManager> <Server output log file 
 is 
 '/u01/Middleware/domains/1034/acs_dom/servers_coherence/CoherenceServer1/logs/CoherenceServer1.out'>
 Exception in thread "Main Thread" java.lang.NoClassDefFoundError: 
 weblogic/nodemanager/server/provider/WeblogicCacheServer
 Caused by: java.lang.ClassNotFoundException: 
 weblogic.nodemanager.server.provider.WeblogicCacheServer
         at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
 
The poblem here is if you leave the classpath blank in the startup properties in the console configuration, then the two minimal jars (weblogic.server.modules.coherence.server_10.3.4.0.jar and coherence.jar) that are required are added for you. Once you specify a non-empty classpath (which is what I did), then you have to explicitly include those jars plus any others you want.

So what I needed was the following.

/u01/Middleware/coherence/370/coherence/lib/coherence.jar:/u01/Middleware/1034/modules/features/weblogic.server.modules.coherence.server_10.3.4.0.jar

Once started the Log file for the coherence server exists on the file system as follows:

$DOMAIN_HOME/servers_coherence/{COH_SERVER_NAME}/logs/{COH_SERVER_NAME}.out

The PID for the server is found here, I normally add that to the log file but it's not possible when starting Coherence this way.

$DOMAIN_HOME/servers_coherence/{COH_SERVER_NAME}/data/nodemanager/{COH_SERVER_NAME}.pid

1 comment:

Anonymous said...

Interesting post. Thank you!