Bug 32130 - NullPointerException in FileStore (sessions)
Summary: NullPointerException in FileStore (sessions)
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Catalina:Modules (show other bugs)
Version: 5.0.28
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords: ErrorMessage
Depends on:
Blocks:
 
Reported: 2004-11-09 20:35 UTC by Ronald Klop
Modified: 2004-11-17 07:00 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ronald Klop 2004-11-09 20:35:27 UTC
I get a stacktrace now and then.
See below.

9-nov-2004 21:28:15 org.apache.catalina.core.StandardContext backgroundProcess
WARNING: Unable to perform background process on manager
java.lang.NullPointerException
        at org.apache.catalina.session.FileStore.keys(FileStore.java:217)
        at org.apache.catalina.session.StoreBase.processExpires(StoreBase.java:
207)
        at org.apache.catalina.session.PersistentManagerBase.
backgroundProcess(PersistentManagerBase.java:227)
        at org.apache.catalina.core.StandardContext.
backgroundProcess(StandardContext.java:4647)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.
processChildren(ContainerBase.java:1619)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.
processChildren(ContainerBase.java:1628)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.
processChildren(ContainerBase.java:1628)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.
run(ContainerBase.java:1608)
        at java.lang.Thread.run(Thread.java:534)
Comment 1 Ronald Klop 2004-11-09 20:44:08 UTC
I think the problem was, that I emptied my tomcat\work directory.
The method FileStore.directory() does not check if the directory still exists 
when returning a (cached) File object to it.
Comment 2 Yoav Shapira 2004-11-17 15:45:28 UTC
If you delete a directory that Tomcat created, you're responsible for re-
creating it.  If we add a check for this we'd have to do the same for every 
directory.  Change your script or actions to remove work/*, not work itself.

The keys method already checks for a null directory.  I added a check for a 
null or empty file list in that directory.  That should cover us.

(Done for 5.0.30)
Comment 3 Yoav Shapira 2004-11-17 16:00:51 UTC
Done for 5.5.5 as well.  Thanks for bringing this to our attention.