Pivotal Knowledge Base

Follow

GemFire HTTP Session Management Modules Not Working with Tomcat / TC Server

Environment 

 Product  Version
 Pivotal GemFire / HTTP session  management modules  7.x or newer
 Tomcat / TC Server  Some maintenance  versions of Tomcat 7.0.x

Symptom

If running Tomcat or the TC Server with the GemFire HTTP session management modules for Tomcat / TC Server based on client-server configuration, depending on the version it can throw the error:

java.lang.NoClassDefFoundError: org/apache/tomcat/util/compat/JreVendor

Complete error message:

[severe 2016/11/16 19:39:02.223 JST server1  tid=0x59] Server connection from [identity(myserver1(1596:loner):56923:a8cab76c,connection=2; port=56923] : Unexpected Error on server
java.lang.NoClassDefFoundError: org/apache/tomcat/util/compat/JreVendor
	at org.apache.catalina.Globals.(Globals.java:363)
	at org.apache.catalina.session.StandardSession.(StandardSession.java:94)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at com.gemstone.gemfire.internal.ClassPathLoader.forName(ClassPathLoader.java:388)
	at com.gemstone.gemfire.internal.InternalDataSerializer.getCachedClass(InternalDataSerializer.java:3993)
	at com.gemstone.gemfire.DataSerializer.readClass(DataSerializer.java:274)
	at com.gemstone.gemfire.internal.InternalDataSerializer.readDataSerializable(InternalDataSerializer.java:2502)
	at com.gemstone.gemfire.internal.InternalDataSerializer.basicReadObject(InternalDataSerializer.java:2921)
	at com.gemstone.gemfire.DataSerializer.readObject(DataSerializer.java:3210)
	at com.gemstone.gemfire.internal.util.BlobHelper.deserializeBlob(BlobHelper.java:110)
	at com.gemstone.gemfire.internal.cache.EntryEventImpl.deserialize(EntryEventImpl.java:1554)
	at com.gemstone.gemfire.internal.cache.EntryEventImpl.deserialize(EntryEventImpl.java:1546)
	at com.gemstone.gemfire.internal.cache.VMCachedDeserializable.getDeserializedValue(VMCachedDeserializable.java:124)
	at com.gemstone.gemfire.internal.cache.EntryEventImpl.processDeltaBytes(EntryEventImpl.java:1334)
	at com.gemstone.gemfire.internal.cache.EntryEventImpl.setNewValueInRegion(EntryEventImpl.java:1196)
	at com.gemstone.gemfire.internal.cache.EntryEventImpl.putExistingEntry(EntryEventImpl.java:1136)
	at com.gemstone.gemfire.internal.cache.AbstractRegionMap.updateEntry(AbstractRegionMap.java:3166)
	at com.gemstone.gemfire.internal.cache.AbstractRegionMap.basicPut(AbstractRegionMap.java:2991)
	at com.gemstone.gemfire.internal.cache.BucketRegion.virtualPut(BucketRegion.java:500)
	at com.gemstone.gemfire.internal.cache.PartitionedRegionDataStore.putLocally(PartitionedRegionDataStore.java:1300)
	at com.gemstone.gemfire.internal.cache.PartitionedRegionDataStore.putLocally(PartitionedRegionDataStore.java:1274)
	at com.gemstone.gemfire.internal.cache.PartitionedRegion.putInBucket(PartitionedRegion.java:2889)
	at com.gemstone.gemfire.internal.cache.PartitionedRegion.virtualPut(PartitionedRegion.java:2088)
	at com.gemstone.gemfire.internal.cache.LocalRegionDataView.putEntry(LocalRegionDataView.java:118)
	at com.gemstone.gemfire.internal.cache.LocalRegion.basicUpdate(LocalRegion.java:5799)
	at com.gemstone.gemfire.internal.cache.LocalRegion.basicBridgePut(LocalRegion.java:5431)
	at com.gemstone.gemfire.internal.cache.tier.sockets.command.Put65.cmdExecute(Put65.java:397)
	at com.gemstone.gemfire.internal.cache.tier.sockets.BaseCommand.execute(BaseCommand.java:182)
	at com.gemstone.gemfire.internal.cache.tier.sockets.ServerConnection.doNormalMsg(ServerConnection.java:799)
	at com.gemstone.gemfire.internal.cache.tier.sockets.ServerConnection.doOneMessage(ServerConnection.java:930)
	at com.gemstone.gemfire.internal.cache.tier.sockets.ServerConnection.run(ServerConnection.java:1179)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at com.gemstone.gemfire.internal.cache.tier.sockets.AcceptorImpl$1$1.run(AcceptorImpl.java:555)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.util.compat.JreVendor
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 36 more

Cause

According to the log messages, the GemFire cache server instance can't find the class org.apache.tomcat.util.compat.JreVendor in the classpath. This class is normally included in the tomcat-util.jar library and you don't see this issue if you follow the documentation for installing GemFire HTTP session modules based on GemFire client-server configuration.

However, some maintenance releases of Tomcat (Later releases of Tomcat 7.0.x) do not include this class in tomcat-util.jar. Instead, it's included in tomcat-coyote.jar. This internal change of Tomcat causes this issue.

Resolution

Add tomcat-coyote.jar into the classpath for GemFire cache servers. You can find tomcat-coyote.jar in the same directory where the tomcat-util.jar library can be found in /path/to/CATALINA_HOME/lib.

 

 

Comments

Powered by Zendesk