Hello everyone!
I use CAS 4.0.0 in a cluster of 2 nodes. I configured the ticket registry using EhCache, as described here: http://jasig.github.io/cas/4.0.0/installation/Ehcache-Ticket-Registry.html
I have disk overflow set to true:
<bean id="abstractTicketCache" abstract="true"
class="org.springframework.cache.ehcache.EhCacheFactoryBean"
p:cacheManager-ref="cacheManager"
p:diskExpiryThreadIntervalSeconds="0"
p:diskPersistent="false"
p:eternal="false"
p:maxElementsInMemory="10000"
p:maxElementsOnDisk="20000"
p:memoryStoreEvictionPolicy="LRU"
p:overflowToDisk="true"
p:bootstrapCacheLoader-ref="ticketCacheBootstrapCacheLoader" />
<bean id="serviceTicketsCache"
class="org.springframework.cache.ehcache.EhCacheFactoryBean"
parent="abstractTicketCache"
p:cacheName="cas_st"
p:timeToIdle="0"
p:timeToLive="300"
p:cacheEventListeners-ref="serviceTicketRMISynchronousCacheReplicator" />
My problem is that from time to time, I get an error when the ticket registry decides to save tickets (STs or TGTs) to disk. An exception is logged in the log, saying that net.sf.ehcache.Cache is not serializable (which is true). Here is an example of the exception:
2014-10-09 10:18:59,266 ERROR [net.sf.ehcache.store.disk.DiskStorageFactory] - <Disk Write of ST-18-sE417I7BTdfhABdhRMNQ-idc-cas-4 failed: >
java.io.NotSerializableException: net.sf.ehcache.Cache
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1180)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:438)
at net.sf.ehcache.Element.writeObject(Element.java:851)
at sun.reflect.GeneratedMethodAccessor138.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:975)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
at net.sf.ehcache.util.MemoryEfficientByteArrayOutputStream.serialize(MemoryEfficientByteArrayOutputStream.java:97)
at net.sf.ehcache.store.disk.DiskStorageFactory.serializeElement(DiskStorageFactory.java:399)
at net.sf.ehcache.store.disk.DiskStorageFactory.write(DiskStorageFactory.java:381)
at net.sf.ehcache.store.disk.DiskStorageFactory$DiskWriteTask.call(DiskStorageFactory.java:473)
at net.sf.ehcache.store.disk.DiskStorageFactory$PersistentDiskWriteTask.call(DiskStorageFactory.java:1067)
at net.sf.ehcache.store.disk.DiskStorageFactory$PersistentDiskWriteTask.call(DiskStorageFactory.java:1051)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Has anybody experienced a similar error? I searched on the Internet but did not find any relevant report.
It seems that CAS tickets indirectly reference the cache which causes Java runtime to try to serialize it too. Unfortunately I haven’t found the path from tickets to caches yet.
A quick workaround would be to set disk overflow to false, I believe, but I’d like to keep it switched on to be able handle bigger loads.
Any help or hint would be much appreciated!
Best Regards,
Jarda
--------------------------------------------------
Jaroslav Kačer
IDC | Application Developer
Phone: +420723914123
Mail: jka...@idc.com
-- You are currently subscribed to cas-...@lists.jasig.org as: jasig-cas-user...@googlegroups.com To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Please open an issue and we’ll investigate this. It’s likely that service ticket objects are missing the setting that would allow them overflow to disk.
You are currently subscribed to cas-...@lists.jasig.org as: mmoa...@unicon.net
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
Thank you for your answer, Misagh.
Here is the issue: https://issues.jasig.org/browse/CAS-1486
Best Regards,
Jarda
You are currently subscribed to cas-...@lists.jasig.org as: jka...@idc.com
To unsubscribe, change settings or access archives, see http://www.ja-sig.org/wiki/display/JSG/cas-user
-- You are currently subscribed to cas-...@lists.jasig.org as: jasig-cas-user...@googlegroups.com
I hate to ask you this, but would you be kind enough to submit the issue on github instead? JIRA is no longer relevant for the CAS server project.
Sure, here it is:
https://github.com/Jasig/cas/issues/724
I wondered why there were only 4 open tickets in Jira J
Thank you very much,