cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From moslm <>
Subject NPE in FileUtils.removeDir( on shutdown
Date Fri, 16 Apr 2010 13:12:27 GMT

I'm using CXF 2.2.5, running on Java 1.6 and Tomcat 6.18.

When the Tomcat server is stopped, we get always the following

INFO: Stopping Coyote HTTP/1.1 on http-8080
Exception in thread "Thread-14" java.lang.NullPointerException
	at org.apache.cxf.helpers.FileUtils.removeDir(
	at org.apache.cxf.helpers.FileUtils$

I did a little debugging:

During the first usage of CXF the FileUtils.getDefaultTempDir() is called.
It resolves the tmp-dir correctly. At the end the 
"private static File defaultTempDir" is set to the right directory.
Then the method schedules the removal of the tmp-dir like this:
             Thread hook = new Thread() {
                public void run() {

So far, so good.  When stopping Tomcat (== stopping the JVM) the hook is
The removeDir(defaultTempDir) is called. But "defaultTempDir" is 'null' and
in consequence
the NPE is thrown.

Any idea why the static defaultTempDir is lost when the ShutdownHooks are
fired?  A Bug?


View this message in context:
Sent from the cxf-user mailing list archive at

View raw message