https://issues.apache.org/bugzilla/show_bug.cgi?id=56785
Bug ID: 56785 Summary: NullPointer in processAnnotationsFile while Applicaiton Startup Product: Tomcat 8 Version: 8.0.8 Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P2 Component: Catalina Assignee: dev@tomcat.apache.org Reporter: juergen.suss...@gmail.com Hello, we go the following exception in Aplicaiton startup. java.lang.NullPointerException at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1966) at org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:1967) at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1920) at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1878) at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1146) at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:768) at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:303) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5069) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ... 6 more The reason was that we added -Duser.dir=<customDir> to give Tomcat a uniqe working dir. Within our <customDir> there was a directory which was not accessible for the tomcat user. It belongs to root and no one else has access. So tomcat tries to scan the user.dir and tries to list files within the restricted dir. Doing so ths file.listFiles() command retuns null (instead of a list of files) which is not correctly handled and causing this Nullpointer and preventing the Server from startup. to recrate set -Duser.dir in setenv.sh to /tmp, create a folder /tmp/test, give permission 700 to /tmp/test, chwon root:root /tmp/test and start a tomcat with at least one application and a user other than root. The fix would be to correctly handle nullpointers or to simply write a meningfull log message. Kind regards Juergen Sussner -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org