Seeing problems in region-based marshalling/unmarshalling with
FileCacheLoader[1].
Looking at the code, it looks like when doing a write with region-based
marshalling enabled, the cache loader isn't writing the region Fqn as
the leading part of the stream. That might be by design, as its OK if
we're *sure* the correct CL will always be assigned to the thread before
*any* attempt is made to read from the persistent store.
It's breaking down though in the FileCacheLoader.doUnmarshall call,
which is calling into the marshaller and letting it decide whether
region-based marshalling is in effect. The marshaller thinks it is, and
tries to unmarshall a leading region Fqn. This fails.
Here's a stack trace showing a failed read from the persistent store.
Read is occuring in preparation for a write, but it's the read that is
failing:
2008-04-20 01:06:27,996 ERROR
[org.jboss.web.tomcat.service.session.JBossCacheManager]
(ContainerBackgroundProcessor[StandardEngine[jboss.web]])
processExpires(): failed removing unloaded session 0Fm8CDBXTJp40M0Wfvjw6Q__
java.lang.ClassCastException: java.util.HashMap
at
org.jboss.cache.marshall.CacheMarshaller200.objectFromObjectStreamRegionBased(CacheMarshaller200.java:175)
at
org.jboss.cache.marshall.CacheMarshaller200.objectFromObjectStream(CacheMarshaller200.java:115)
at
org.jboss.cache.marshall.VersionAwareMarshaller.objectFromObjectStream(VersionAwareMarshaller.java:324)
at
org.jboss.cache.loader.FileCacheLoader.doUnmarshall(FileCacheLoader.java:473)
at
org.jboss.cache.loader.AbstractCacheLoader.regionAwareUnmarshall(AbstractCacheLoader.java:221)
at
org.jboss.cache.loader.FileCacheLoader.loadAttributes(FileCacheLoader.java:426)
at org.jboss.cache.loader.FileCacheLoader.put(FileCacheLoader.java:247)
at org.jboss.cache.loader.FileCacheLoader.put(FileCacheLoader.java:238)
at
org.jboss.cache.interceptors.PassivationInterceptor.handleEvictMethod(PassivationInterceptor.java:53)
at
org.jboss.cache.interceptors.MethodDispacherInterceptor.invoke(MethodDispacherInterceptor.java:126)
at
org.jboss.cache.interceptors.Interceptor.nextInterceptor(Interceptor.java:111)
at
org.jboss.cache.interceptors.MethodDispacherInterceptor.invoke(MethodDispacherInterceptor.java:58)
at
org.jboss.cache.interceptors.Interceptor.nextInterceptor(Interceptor.java:111)
at
org.jboss.cache.interceptors.PessimisticLockInterceptor.handleEvictMethod(PessimisticLockInterceptor.java:341)
at
org.jboss.cache.interceptors.MethodDispacherInterceptor.invoke(MethodDispacherInterceptor.java:126)
at
org.jboss.cache.interceptors.PessimisticLockInterceptor.invoke(PessimisticLockInterceptor.java:81)
at
org.jboss.cache.interceptors.Interceptor.nextInterceptor(Interceptor.java:111)
at
org.jboss.cache.interceptors.MethodDispacherInterceptor.invoke(MethodDispacherInterceptor.java:58)
at
org.jboss.cache.interceptors.Interceptor.nextInterceptor(Interceptor.java:111)
at
org.jboss.cache.interceptors.MethodDispacherInterceptor.invoke(MethodDispacherInterceptor.java:58)
at
org.jboss.cache.interceptors.Interceptor.nextInterceptor(Interceptor.java:111)
at
org.jboss.cache.interceptors.TxInterceptor.handleNonTxMethod(TxInterceptor.java:456)
at
org.jboss.cache.interceptors.TxInterceptor.handleEvictMethod(TxInterceptor.java:200)
at
org.jboss.cache.interceptors.MethodDispacherInterceptor.invoke(MethodDispacherInterceptor.java:126)
at
org.jboss.cache.interceptors.Interceptor.nextInterceptor(Interceptor.java:111)
at
org.jboss.cache.interceptors.CacheMgmtInterceptor.handleEvictMethod(CacheMgmtInterceptor.java:64)
at
org.jboss.cache.interceptors.MethodDispacherInterceptor.invoke(MethodDispacherInterceptor.java:126)
at
org.jboss.cache.interceptors.Interceptor.nextInterceptor(Interceptor.java:111)
at
org.jboss.cache.interceptors.InvocationContextInterceptor.invoke(InvocationContextInterceptor.java:73)
at
org.jboss.cache.invocation.AbstractInvocationDelegate.invoke(AbstractInvocationDelegate.java:123)
at
org.jboss.cache.invocation.AbstractInvocationDelegate.invoke(AbstractInvocationDelegate.java:64)
at
org.jboss.cache.invocation.CacheInvocationDelegate.evict(CacheInvocationDelegate.java:380)
at
org.jboss.cache.invocation.CacheInvocationDelegate.evictChildren(CacheInvocationDelegate.java:355)
at
org.jboss.cache.invocation.CacheInvocationDelegate.evict(CacheInvocationDelegate.java:340)
at
org.jboss.web.tomcat.service.session.JBossCacheWrapper.evictSubtree(JBossCacheWrapper.java:273)
at
org.jboss.web.tomcat.service.session.JBossCacheService.evictSession(JBossCacheService.java:388)
at
org.jboss.web.tomcat.service.session.JBossCacheManager.processUnloadedSessionPassivation(JBossCacheManager.java:1795)
at
org.jboss.web.tomcat.service.session.JBossCacheManager.processExpires(JBossCacheManager.java:1554)
at
org.jboss.web.tomcat.service.session.JBossManager.backgroundProcess(JBossManager.java:895)
at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1316)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:595)
--
Brian Stansberry
Lead, AS Clustering
JBoss, a division of Red Hat
brian.stansberry(a)redhat.com