Caused by: java.io.StreamCorruptedException: invalid stream header: 00000000at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:857) ~[?:1.8.0_144]at java.io.ObjectInputStream.<init>(ObjectInputStream.java:349) ~[?:1.8.0_144]at net.sf.ehcache.util.PreferTCCLObjectInputStream.<init>(PreferTCCLObjectInputStream.java:39) ~[ehcache-core-2.5.0.jar!/:?]at net.sf.ehcache.store.disk.DiskStorageFactory.read(DiskStorageFactory.java:375) ~[ehcache-core-2.5.0.jar!/:?]at net.sf.ehcache.store.disk.DiskStorageFactory.retrieve(DiskStorageFactory.java:936) ~[ehcache-core-2.5.0.jar!/:?]at net.sf.ehcache.store.disk.Segment.decode(Segment.java:167) ~[ehcache-core-2.5.0.jar!/:?]at net.sf.ehcache.store.disk.Segment.put(Segment.java:444) ~[ehcache-core-2.5.0.jar!/:?]at net.sf.ehcache.store.disk.DiskStore.put(DiskStore.java:475) ~[ehcache-core-2.5.0.jar!/:?]at net.sf.ehcache.store.FrontEndCacheTier.put(FrontEndCacheTier.java:221) ~[ehcache-core-2.5.0.jar!/:?]at net.sf.ehcache.Cache.putInternal(Cache.java:1492) ~[ehcache-core-2.5.0.jar!/:?]at net.sf.ehcache.Cache.put(Cache.java:1417) ~[ehcache-core-2.5.0.jar!/:?]at net.sf.ehcache.Cache.put(Cache.java:1382) ~[ehcache-core-2.5.0.jar!/:?]at org.apache.shiro.cache.ehcache.EhCache.put(EhCache.java:102) ~[shiro-ehcache-1.2.6.jar!/:1.2.6]... 62 more
注:因为ehache缺省配置是持久化硬盘的,而两个项目的cache存储库相同,导致反序列化时发生错误。
解决:cache存储库设置不同 或修改ehcache.xml,设置缺省cache的diskPersistent="false"即可