Exception during Tomcat startup exception loading sessions from persistent Storage

Source: Internet
Author: User

Exception loading sessions from persistent Storage
Java. Io. eofexception
At java. Io. objectinputstream $ peekinputstream. readfully (objectinputstream. Java: 2228)
At java. Io. objectinputstream $ blockdatainputstream. readshort (objectinputstream. Java: 2694)
At java. Io. objectinputstream. readstreamheader (objectinputstream. Java: 761)
At java. Io. objectinputstream. <init> (objectinputstream. Java: 277)
At org. Apache. Catalina. util. customobjectinputstream. <init> (customobjectinputstream. Java: 56)
At org. Apache. Catalina. session. standardmanager. doload (standardmanager. Java: 384)
At org. Apache. Catalina. session. standardmanager. Load (standardmanager. Java: 343)
At org. Apache. Catalina. session. standardmanager. Start (standardmanager. Java: 657)
At org. Apache. Catalina. Core. containerbase. setmanager (containerbase. Java: 499)
At org. Apache. Catalina. startup. contextconfig. managerconfig (contextconfig. Java: 315)
At org. Apache. Catalina. startup. contextconfig. Start (contextconfig. Java: 635)
At org. Apache. Catalina. startup. contextconfig. lifecycleevent (contextconfig. Java: 216)
At org. Apache. Catalina. util. lifecyclesupport. firelifecycleevent (lifecyclesupport. Java: 119)
At org. Apache. Catalina. Core. standardcontext. Start (standardcontext. Java: 4290)
At org. Apache. Catalina. Core. containerbase. addchildinternal (containerbase. Java: 823)
At org. Apache. Catalina. Core. containerbase. addchild (containerbase. Java: 807)
At org. Apache. Catalina. Core. standardhost. addchild (standardhost. Java: 595)
At org. Apache. Catalina. Core. standardhostdeployer. Install (standardhostdeployer. Java: 277)
At org. Apache. Catalina. Core. standardhost. Install (standardhost. Java: 832)
At org. Apache. Catalina. startup. hostconfig. deploydirectories (hostconfig. Java: 701)
At org. Apache. Catalina. startup. hostconfig. deployapps (hostconfig. Java: 432)
At org. Apache. Catalina. startup. hostconfig. Start (hostconfig. Java: 983)
At org. Apache. Catalina. startup. hostconfig. lifecycleevent (hostconfig. Java: 349)
At org. Apache. Catalina. util. lifecyclesupport. firelifecycleevent (lifecyclesupport. Java: 119)
At org. Apache. Catalina. Core. containerbase. Start (containerbase. Java: 1091)
At org. Apache. Catalina. Core. standardhost. Start (standardhost. Java: 789)
At org. Apache. Catalina. Core. containerbase. Start (containerbase. Java: 1083)
At org. Apache. Catalina. Core. standardengine. Start (standardengine. Java: 478)
At org. Apache. Catalina. Core. standardservice. Start (standardservice. Java: 480)
At org. Apache. Catalina. Core. standardserver. Start (standardserver. Java: 2313)
At org. Apache. Catalina. startup. Catalina. Start (Catalina. Java: 556)
At sun. Reflect. nativemethodaccessorimpl. invoke0 (native method)
At sun. Reflect. nativemethodaccessorimpl. Invoke (nativemethodaccessorimpl. Java: 39)
At sun. Reflect. delegatingmethodaccessorimpl. Invoke (delegatingmethodaccessorimpl. Java: 25)
At java. Lang. Reflect. method. Invoke (method. Java: 585)
At org. Apache. Catalina. startup. Bootstrap. Start (Bootstrap. Java: 287)
At org. Apache. Catalina. startup. Bootstrap. Main (Bootstrap. Java: 425)

Analysis: when the session does not time out, the server will be serialized as project name \ sessions when it is disabled. ser, Tomcat is loaded when it is started. eofexception indicates that there are some active connections when Tomcat was closed last time, so Tomcat tries to restore these sessions when it is restarted, however, during the input process, it is expected that the signal arrives at the end of the file or the end of the stream, leading to data acquisition from the session failure. Exception is caused by Tomcat itself. Due to the abnormal shutdown of Tomcat last time, some active sessions are held.
Jiuhua (represented by some temporary files), Tomcat tries to restore the persistent data of these sessions during restart but fails to read the data. This exception does not affect system usage.

Solution: delete atat_home \ work \ Catalina \ localhost \ "project name" \ sessions. Ser. If the server is disabled normally, the file is automatically deleted. Considering that each user's Tomat working directory is different, we recommend that you find your sessions in the "Search" function. ser file, and you only need to delete .. sessions under \ yourprojectname. ser.

The simplest way is to delete all the work and restart tomcat.

The following describes the working directory of Tomcat:

1. When Tomcat is used as a Web server, the deployed programs are all compiled programs under webapps (the classes included in the Project released to Tomcat will be compiled. the source file is not released, but the JSP file is not compiled ). Tomcat has a work directory that stores the page cache, And the accessed JSP will be compiled (the project in the localhost site folder After Catalina is entered from work, we can see those JSP
The page will be compiled into a Servlet File. When you visit the page next time, you can directly run the servlet class to respond to the page to the client. So some blogs say that the first visit will be slow, the reason is that the newly released page is first compiled into a Servlet File when the first person accesses it, so it is slow. Once compiled, unless the JSP page is modified, otherwise, you can directly run the servlet at the next access to respond to the user. Therefore, the compiled files will be stored in the work directory. The directory displayed by Tomcat will find the class file corresponding to the compiled jsp from this cache. Therefore, after the work directory is cleared, the process will start again.
Sometimes there is a problem, that is, the modified page cannot display the modified trace when running tomcat. In this case, delete the corresponding project folder under the Work directory and restart tomcat.

2. In the conf configuration folder of Tomcat. after the host name is configured in the XML file, the folder of the site name will be created under the Catalina folder under conf and the Catalina file under work. Each time the project is published, it will be placed, it will also be recorded in the configuration file of the Catalina folder under Conf.

From: http://getspring.blog.163.com/blog/static/115300609201073010022281/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.