gpt4 book ai didi

java - 在 Eclipse 中运行 Tomcat 并获得 "Exception loading sessions from persistent storage"

转载 作者:行者123 更新时间:2023-11-28 22:37:50 27 4
gpt4 key购买 nike

我使用 Eclipse Kepler 开发基于 Sprig/Hibernate/PostgreSQL 的应用程序。该应用程序在由 Eclipse 管理的 Tomcat 中运行。这通常工作正常。

修改并保存任何 jsp 大约 10 次后,出现以下异常:

Jan 17, 2014 9:53:33 AM org.apache.catalina.core.StandardContext reloadINFO: Reloading Context with name [/app] has startedJan 17, 2014 9:53:33 AM org.apache.catalina.core.ApplicationContext logINFO: Destroying Spring FrameworkServlet 'dispatcherServlet'Jan 17, 2014 9:53:33 AM org.apache.catalina.core.ApplicationContext logINFO: Closing Spring root WebApplicationContext[DEBUG] [ContainerBackgroundProcessor[StandardEngine[Catalina]] 17.01.14 09:53:33] (Utils.java:logSystemState:365) System Info: active sessions:  1, availableProcessors:  8, maxMemory: 1754 MB, totalMemory:  658 MB, freeMemory:  110 MB, loadAverage: 0.11[DEBUG] [ContainerBackgroundProcessor[StandardEngine[Catalina]] 17.01.14 09:53:33] (LifeCycle.java:destroy:89) APP 1.1.4 (built on Fri, 17.01.2014, 09:55), destroyed at /app, running on target environment 'dev'. Uptime: 1 hour, 4 minutes, 7 seconds and 314 milliseconds. Spring: 3.2.6.RELEASE, Hibernate: 4.2.8.FinalJan 17, 2014 9:53:33 AM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbcSEVERE: The web application [/app] registered the JDBC driver [org.postgresql.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.Jan 17, 2014 9:53:36 AM org.apache.catalina.core.ApplicationContext logINFO: No Spring WebApplicationInitializer types detected on classpathJan 17, 2014 9:53:36 AM org.apache.catalina.core.ApplicationContext logINFO: Initializing Spring root WebApplicationContext...Jan 17, 2014 9:53:37 AM org.apache.catalina.session.StandardManager startInternalSEVERE: Exception loading sessions from persistent storagejava.lang.ClassNotFoundException: com.mycompany.app.spring.AuthenticationWrapper    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)    at java.lang.Class.forName0(Native Method)    at java.lang.Class.forName(Class.java:270)    at org.apache.catalina.util.CustomObjectInputStream.resolveClass(CustomObjectInputStream.java:76)    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1610)    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515)    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769)    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1989)    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1913)    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1796)    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)    at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1595)    at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1060)    at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:284)    at org.apache.catalina.session.StandardManager.load(StandardManager.java:204)    at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:491)    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5443)    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)    at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3954)    at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:426)    at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1345)    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530)    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1519)    at java.lang.Thread.run(Thread.java:724)Jan 17, 2014 9:53:37 AM org.apache.catalina.core.StandardContext startInternalSEVERE: Context [/app] startup failed due to previous errorsJan 17, 2014 9:53:37 AM org.apache.catalina.core.ApplicationContext logINFO: Closing Spring root WebApplicationContextJan 17, 2014 9:53:37 AM org.apache.catalina.core.StandardContext reloadINFO: Reloading Context with name [/app] is completed

唯一的解决办法是停止 Tomcat,执行 Project->Clean,然后重新启动 Tomcat。当然 session 丢失了,我必须重新登录应用程序。

这个问题严重影响了我的开发流程,至今没有找到解决办法。

怀疑文件系统问题,我尝试在 tmpfs 中创建一个文件夹并将其用作 Tomcat 的服务器路径(在 Eclipse 中设置),但它没有改变任何东西。

请注意,这仅发生在我的笔记本电脑 (Kubuntu 13.10) 上。我的一位同事使用同一台笔记本电脑且操作系统相同,但没有发现问题。

问题似乎是文件系统上的 session 已损坏,而 Tomcat 会因此而阻塞。为什么会这样?

最佳答案

消除此错误的一种方法是在重新启动时禁用 session 持久性。您可以通过编辑文件 CATALINA_HOME/conf/context.xml 并设置 <Manager> 的路径名属性来完成此操作。为空字符串。

您还应该在 Tomcat 关闭时从 CATALINA_HOME/work/Catalina/localhost/ 文件夹中删除任何旧的 session.ser 文件。

发生这种情况可能是因为 Tomcat 没有完全关闭,因此 session 对象在序列化期间被损坏。

关于java - 在 Eclipse 中运行 Tomcat 并获得 "Exception loading sessions from persistent storage",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21181964/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com