Deserialization not allowed error

Issue

After upgrading to AEM 6.2 or later version the application is failing with "Deserialization not allowed for class" errors (see example below). 

java.lang.UnsupportedOperationException: Deserialization not allowed for class net.sf.ehcache.Element (on Thu Sep 21 12:29:55 CDT 2017)
at org.kantega.notsoserial.DefaultNotSoSerial.preventDeserialization(DefaultNotSoSerial.java:256)
at org.kantega.notsoserial.DefaultNotSoSerial.onBeforeResolveClass(DefaultNotSoSerial.java:248)
at org.kantega.notsoserial.ObjectInputStreamClassVisitor.onBeforeResolveClass(ObjectInputStreamClassVisitor.java:48)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1613)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1518)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1774)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
at net.sf.ehcache.store.disk.DiskStorageFactory.read(DiskStorageFactory.java:370)
at net.sf.ehcache.store.disk.DiskStorageFactory.retrieve(DiskStorageFactory.java:886)
at net.sf.ehcache.store.disk.Segment.decode(Segment.java:172)
at net.sf.ehcache.store.disk.Segment.put(Segment.java:449)
at net.sf.ehcache.store.disk.DiskStore.put(DiskStore.java:438)
at net.sf.ehcache.store.FrontEndCacheTier.put(FrontEndCacheTier.java:267)
at net.sf.ehcache.Cache.putInternal(Cache.java:1455)
at net.sf.ehcache.Cache.put(Cache.java:1383)
at net.sf.ehcache.Cache.put(Cache.java:1348)

Environment

AEM 6.2 and later versions

Cause

This is caused by the nososerial security fix which is applied to AEM.  To fix the error you can whitelist certain java classes allowing deserialization.

Add a whitelist file by adding this JVM parameter:

-Dnotsoserial.whitelist=is-deserialized.txt

Resolution

-javaagent:notsoserial.jar -Dnotsoserial.whitelist=empty.txt -Dnotsoserial.dryrun=is-deserialized.txt

 Adobe

更快、更輕鬆地獲得協助

新的使用者?

Adobe MAX 2024

Adobe MAX
創意大會

10 月 14 至 16 日邁阿密海灘和線上

Adobe MAX

創意大會

10 月 14 至 16 日邁阿密海灘和線上

Adobe MAX 2024

Adobe MAX
創意大會

10 月 14 至 16 日邁阿密海灘和線上

Adobe MAX

創意大會

10 月 14 至 16 日邁阿密海灘和線上