从持久存储中加载异常会话,扩展

Exception loading sessions from persistent storage, extended

我明白了

Aug 25, 2017 3:35:42 PM org.apache.catalina.session.StandardManager startInternal
SCHWERWIEGEND: Exception loading sessions from persistent storage
java.lang.ClassCastException: java.lang.String cannot be cast to java.io.ObjectStreamClass
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1511)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1997)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1921)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
        at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1608)
        at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1074)
        at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:259)
        at org.apache.catalina.session.StandardManager.load(StandardManager.java:176)
        at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:465)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5593)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1091)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1980)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        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:745)

((HttpSession) getContextProperty("Session")).setAttribute(name, value);

投掷

Fri Aug 25 15:35:47 GMT+01:00 2017
Server Exception. ID: 72acb94e_15e19d20417_12
java.lang.NullPointerException
        at de.supportgis.gdi.gdigui.GDIApplication.setSessionAttribute(GDIApplication.java:187)
        at de.supportgis.gdi.gdigui.GDIApplication.setCurrentUserLocale(GDIApplication.java:156)
        at de.supportgis.gdi.gdigui.components.StandardContentPanel.getLS(StandardContentPanel.java:236)
        at de.supportgis.gdi.gdigui.content.Login.<init>(Login.java:68)
        at de.supportgis.gdi.gdigui.GDIApplication.init(GDIApplication.java:62)
        at nextapp.echo.app.ApplicationInstance.doInit(ApplicationInstance.java:288)
        at nextapp.echo.webcontainer.UserInstance.prepareApplicationInstance(UserInstance.java:484)
        at nextapp.echo.webcontainer.ComponentInputProcessor.process(ComponentInputProcessor.java:160)
        at nextapp.echo.webcontainer.ClientMessage.process(ClientMessage.java:194)
        at nextapp.echo.webcontainer.InputProcessor.process(InputProcessor.java:163)
        at nextapp.echo.webcontainer.Synchronization.process(Synchronization.java:121)
        at nextapp.echo.webcontainer.service.SynchronizeService.service(SynchronizeService.java:78)
        at nextapp.echo.webcontainer.WebContainerServlet.process(WebContainerServlet.java:432)
        at de.supportgis.gdi.gdigui.StartServlet.process(StartServlet.java:37)
        at nextapp.echo.webcontainer.WebContainerServlet.doPost(WebContainerServlet.java:316)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:221)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)

我想这不是重复的,因为我检查并应用了 exception loading sessions from persistent storage 中的每个答案但没有成功,例如:


我没有损坏的符号链接:

find / -xtype l 2>/dev/null

returns 没有相关内容。


我猜这是来自 apt dist-upgrade 的文件系统权限问题。我真的必须重新安装漏洞服务器吗?

方法 GDIApplication.setSessionAttribute(第二个堆栈跟踪)调用 getContextProperty("Session") 导致 NPE?

方法 ApplicationInstance.getContextProperty("Session") 属于 Echo 框架 (https://github.com/echo3/echo3)。我不确定它是如何获取 Session 对象的,但第一个堆栈跟踪中的 ClassCastException 可能会干扰它。

尝试替换

((HttpSession) getContextProperty("Session")).setAttribute(name, value);

Connection conn = WebContainerServlet.getActiveConnection();
conn.getRequest().getSession().setAttribute(name, value);

这使您可以访问当前的 ServletRequest,并允许您使用 Java 的 ServletRequest.getSession() 方法检索会话,如果会话尚不存在,该方法将创建该会话。

至于会话重新创建期间的ClassCastException:除了您已经尝试过的方法,我不知道还有什么其他方法。但是如果上面的提示有效,这些异常可能仍然很烦人,但可能是无害的。我承认,他们出现的时候我一般都会无视...

清除 \work\Catalina\localhost 文件夹中的文件解决了问题