If the default application "/" is stopped then is subsequently accessed via a webbrowser the following NPE occurs. However, if a seperate user-installed application is installed and then stopped it results in an error report indicating: HTTP Status 503 - This application is not currently available. In the code in the Mapper for the rule 4c - welcome resources processing: --snip-- try { file = context.resources.lookup(pathStr); } catch(NamingException nex) { // Swallow not found, since this is normal } --snip-- It will catch a naming exception and continue on, but not a NPE.. -------------------------------------------------------------------------- SEVERE: An exception or error occurred in the container during the request processing java.lang.NullPointerException at java.lang.String.startsWith(Unknown Source) at java.lang.String.startsWith(Unknown Source) at org.apache.naming.resources.FileDirContext.file(FileDirContext.java:841) at org.apache.naming.resources.FileDirContext.getAttributes(FileDirContext.java:432) at org.apache.naming.resources.BaseDirContext.getAttributes(BaseDirContext.java:724) at org.apache.naming.resources.ProxyDirContext.cacheLoad(ProxyDirContext.java:1525) at org.apache.naming.resources.ProxyDirContext.cacheLookup(ProxyDirContext.java:1448) at org.apache.naming.resources.ProxyDirContext.lookup(ProxyDirContext.java:282) at org.apache.tomcat.util.http.mapper.Mapper.internalMapWrapper(Mapper.java:732) at org.apache.tomcat.util.http.mapper.Mapper.internalMap(Mapper.java:622) at org.apache.tomcat.util.http.mapper.Mapper.map(Mapper.java:512) at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:272) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:146) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Unknown Source)
This will only happen if no resource is entered. Eg. Accessing "http://localhost/" or "http://localhost" will cause the NPE error But, accessing "http://localhost/test.html" will cause it to correctly return a HTTP Status 503 - This application is not currently available response.
The NPE occurs becasue FileDirContext#release sets absoluteBase to null. absoluteBase is the argument to the String#startsWith call on line 841. I've added a check for that case to avoid the immediate NPE. Thanks for reporting it.