<>Symptom: Multiple instances of CFMX 6.1 on JRun 4 configured as a JRun cluster and using J2EE sessions with intent to enable session replication writes the stack trace below to the server's event log and session replication does not work although failover does occur.

From {server}-event.log:

# Created by JRun on 09/29 11:23:07
09/29 11:23:07 error Setup of session replication failed.
[1]java.lang.NoClassDefFoundError: Lcoldfusion/runtime/J2eeSessionScopeStub;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:1514)
at java.lang.Class.getDeclaredField(Class.java:1206)
at java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1474)
at java.io.ObjectStreamClass.access$400(ObjectStreamClass.java:47)
at java.io.ObjectStreamClass$3.run(ObjectStreamClass.java:335)
at java.security.AccessController.doPrivileged(Native Method)
at java.io.ObjectStreamClass.INIT(ObjectStreamClass.java:333)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:253)
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:453)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1521)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:452)
at coldfusion.runtime.J2eeSessionScopeStub.readObject(J2eeSessionScopeStub.java:84)


Environment : CFMX 6.1 on JRun4 Build 63824. (Build number obtained with "jrun -info"). This is the build that comes with the CFMX installer. All platforms.

Diagnosis : When using the CFMX 6.1 installer to also install JRun 4 with ColdFusion already deployed, the JRun jvm.config file has additional entries in the Java classpath when compared to the jvm.config from a plain JRun4 SP2 build 61650 server installed from an independent JRun installer package. Specifically, the cfusion.jar and the ColdFusion lib directory are in the classpath on build 63824, but not on 61650.

Solution : Remove the cfusion.jar and ColdFusion lib from the classpath as shown here, restart all servers, and session replication will work successfully.

Before:
# JVM classpath
java.class.path={application.home}/servers/lib, {application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib, {application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/cfusion.jar, {application.home}/lib/jrun.jar, {application.home}/lib/code
After:
# JVM classpath
java.class.path={application.home}/servers/lib, {application.home}/lib/jrun.jar,{application.home}/lib