NutzCN Logo
问答 /sysadmin 登入 报错java.io.OptionalDataException
发布于 1285天前 作者 小小菜鸟 2393 次浏览 复制 上一个帖子 下一个帖子
标签: nutzwk
[DEBUG] 11:33:36.745 org.apache.shiro.web.servlet.SimpleCookie.readValue(SimpleCookie.java:389) - Found 'sid' cookie value [59fr7fiah8ha1pe7q9n7q1qv04]
[WARN ] 11:33:36.748 org.eclipse.jetty.server.HttpChannel.handleException(HttpChannel.java:584) - /gr/sysadmin java.io.OptionalDataException
[DEBUG] 11:33:36.750 org.apache.shiro.web.servlet.SimpleCookie.readValue(SimpleCookie.java:389) - Found 'sid' cookie value [59fr7fiah8ha1pe7q9n7q1qv04]
[WARN ] 11:33:36.752 org.eclipse.jetty.server.handler.ErrorHandler.doError(ErrorHandler.java:126) - EXCEPTION 
javax.servlet.ServletException: Filtered request failed.
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:384)
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1602)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:540)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:566)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1588)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1557)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
	at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:227)
	at org.eclipse.jetty.server.Dispatcher.error(Dispatcher.java:86)
	at org.eclipse.jetty.server.handler.ErrorHandler.doError(ErrorHandler.java:119)
	at org.eclipse.jetty.server.handler.ErrorHandler.handle(ErrorHandler.java:78)
	at org.eclipse.jetty.server.Response.sendError(Response.java:655)
	at org.eclipse.jetty.server.handler.AbstractHandler.doError(AbstractHandler.java:100)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1339)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1557)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
	at org.eclipse.jetty.server.Server.handle(Server.java:502)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:419)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.shiro.cache.CacheException: net.sf.ehcache.CacheException: java.io.OptionalDataException
	at org.apache.shiro.cache.ehcache.EhCache.get(EhCache.java:85)
	at org.nutz.plugins.cache.impl.lcache.LCache.get(LCache.java:34)
	at org.apache.shiro.session.mgt.eis.CachingSessionDAO.getCachedSession(CachingSessionDAO.java:217)
	at org.apache.shiro.session.mgt.eis.CachingSessionDAO.getCachedSession(CachingSessionDAO.java:202)
	at org.apache.shiro.session.mgt.eis.CachingSessionDAO.readSession(CachingSessionDAO.java:259)
	at org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSessionFromDataSource(DefaultSessionManager.java:236)
	at org.apache.shiro.session.mgt.DefaultSessionManager.retrieveSession(DefaultSessionManager.java:222)
	at org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doGetSession(AbstractValidatingSessionManager.java:118)
	at org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupSession(AbstractNativeSessionManager.java:148)
	at org.apache.shiro.session.mgt.AbstractNativeSessionManager.getSession(AbstractNativeSessionManager.java:140)
	at org.apache.shiro.mgt.SessionsSecurityManager.getSession(SessionsSecurityManager.java:156)
	at org.apache.shiro.mgt.DefaultSecurityManager.resolveContextSession(DefaultSecurityManager.java:456)
	at org.nutz.boot.starter.shiro.ShiroEnvStarter$1.resolveSession(ShiroEnvStarter.java:124)
	at org.apache.shiro.mgt.DefaultSecurityManager.createSubject(DefaultSecurityManager.java:338)
	at org.apache.shiro.subject.Subject$Builder.buildSubject(Subject.java:846)
	at org.apache.shiro.web.subject.WebSubject$Builder.buildWebSubject(WebSubject.java:148)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.createSubject(AbstractShiroFilter.java:292)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:359)
	... 39 more
Caused by: net.sf.ehcache.CacheException: java.io.OptionalDataException
	at net.sf.ehcache.store.disk.DiskStorageFactory.retrieve(DiskStorageFactory.java:891)
	at net.sf.ehcache.store.disk.Segment.decodeHit(Segment.java:182)
	at net.sf.ehcache.store.disk.Segment.get(Segment.java:225)
	at net.sf.ehcache.store.disk.DiskStore.fault(DiskStore.java:210)
	at net.sf.ehcache.store.CacheStore$4.call(CacheStore.java:198)
	at net.sf.ehcache.store.CacheStore$4.call(CacheStore.java:192)
	at net.sf.ehcache.store.cachingtier.OnHeapCachingTier$Fault.get(OnHeapCachingTier.java:334)
	at net.sf.ehcache.store.cachingtier.OnHeapCachingTier$Fault.access$200(OnHeapCachingTier.java:311)
	at net.sf.ehcache.store.cachingtier.OnHeapCachingTier.get(OnHeapCachingTier.java:175)
	at net.sf.ehcache.store.CacheStore.get(CacheStore.java:192)
	at net.sf.ehcache.Cache.get(Cache.java:1751)
	at org.apache.shiro.cache.ehcache.EhCache.get(EhCache.java:73)
	... 56 more
Caused by: java.io.OptionalDataException
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1588)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:428)
	at java.util.HashMap.readObject(HashMap.java:1407)
	at sun.reflect.GeneratedMethodAccessor143.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1158)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2173)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2064)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1568)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:428)
	at org.apache.shiro.session.mgt.SimpleSession.readObject(SimpleSession.java:500)
	at sun.reflect.GeneratedMethodAccessor145.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1158)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2173)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2064)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1568)
	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2282)
	at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:558)
	at net.sf.ehcache.Element.readObject(Element.java:884)
	at sun.reflect.GeneratedMethodAccessor144.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1158)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2173)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2064)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1568)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:428)
	at net.sf.ehcache.store.disk.DiskStorageFactory.read(DiskStorageFactory.java:371)
	at net.sf.ehcache.store.disk.DiskStorageFactory.retrieve(DiskStorageFactory.java:887)
	... 67 more
8 回复

vue端 突然的报错 我百度了一下貌似都是说 ehcache 缓存的问题 但是我项目是连接了redis的 这个时候不会切换到 redis为缓存吗?
然后是怎么去删 这个缓存呢?

看ehcache.xml

大神没看到 ehcache.xml文件哦\\
这样的就有 在.idea文件下 Maven__org_apache_shiro_shiro_ehcache_1_3_2.xml
但是表明的是jar 在哪了吧 没有看到文件的












<component name="libraryTable">
  <library name="Maven: org.apache.shiro:shiro-ehcache:1.3.2">
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/shiro/shiro-ehcache/1.3.2/shiro-ehcache-1.3.2.jar!/" />
    </CLASSES>
    <JAVADOC>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/shiro/shiro-ehcache/1.3.2/shiro-ehcache-1.3.2-javadoc.jar!/" />
    </JAVADOC>
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/org/apache/shiro/shiro-ehcache/1.3.2/shiro-ehcache-1.3.2-sources.jar!/" />
    </SOURCES>
  </library>
</component>

nutzwk有ehcache.xml的,仔细找

确实没找到,直接搜索文件都没有.我的是nutzboot-dubbo分支的哦😯

各种查 终于在shiro-ehcache-xx.jar里面找到了ehcache.xml 内容显示缓存写到了

<diskStore path="java.io.tmpdir/shiro-ehcache"/>

当然 我这边文件是shiro-active%0053ession%0043ache.data
但是我依然没弄明白为什么会 报错 是这个cookie对于的缓存突然没掉了吗(比如系统自动清掉了?)

添加回复
请先登陆
回到顶部