You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2006/01/06 01:47:15 UTC

DO NOT REPLY [Bug 38154] New: - NPE when accessing default context "/" after it is stopped

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38154>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38154

           Summary: NPE when accessing default context "/" after it is
                    stopped
           Product: Tomcat 5
           Version: 5.5.12
          Platform: PC
        OS/Version: Windows 2000
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: jmaher@linwoodhomes.com


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)

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 38154] - NPE when accessing default context "/" after it is stopped

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38154>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38154


yoavs@computer.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From yoavs@computer.org  2006-04-13 18:45 -------
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.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


DO NOT REPLY [Bug 38154] - NPE when accessing default context "/" after it is stopped

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38154>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38154





------- Additional Comments From jmaher@linwoodhomes.com  2006-01-06 01:54 -------
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.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org