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 2013/07/10 04:02:11 UTC

[Bug 55230] New: DirContextURLConnection.getInputStream() fails to reopen resources for ProxyDirContext

https://issues.apache.org/bugzilla/show_bug.cgi?id=55230

            Bug ID: 55230
           Summary: DirContextURLConnection.getInputStream() fails to
                    reopen resources for ProxyDirContext
           Product: Tomcat 7
           Version: 7.0.39
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: zikfat@gmail.com

There appears to be a bug in the DirContextURLConnection where it fails to
reopen the resource in the getInputStream method when its context is a
ProxyDirContext.

The DirContextURLConnection's connect method has some special case code for the
ProxyDirContext where it's stripping the hostName and the contextPath off of
the path given by the URL, and then using that stripped path in its
context.lookup call. This part works great.

However, in the getInputStream method the DirContextURLConnection attempts to
reopen the resource without doing this special case logic on the path used in
the context lookup. It tries to look up the resource with the raw path from the
URL object, which fails. A NamingException is thrown, which is swallowed, and
the potentially stale resource from the initial call to connect is returned
instead.


In my application this isn't causing a logic issue because the resources I'm
looking up aren't changing between the initial connection and the first call to
getInputStream, but this bug is manifesting as a notable performance problem.
Every time a bad path is passed into the ProxyDirContext it's actually causing
quite a lot of NamingExceptions to be thrown as it tries alternative paths (see
BaseDirContext.lookup). All of these exceptions are swallowed but what I'm
seeing is that this is happening many times over the course of a request as my
application is looking up different resources, and the time it takes to build
all of these swallowed NamingExceptions has become significant.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 55230] DirContextURLConnection.getInputStream() fails to reopen resources for ProxyDirContext

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55230

--- Comment #2 from zikfat@gmail.com ---
That is excellent news. Thanks!

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


[Bug 55230] DirContextURLConnection.getInputStream() fails to reopen resources for ProxyDirContext

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55230

Mark Thomas <ma...@apache.org> changed:

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

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Thanks for the report. This has been fixed in 7.0.x (trunk has a completely
re-written resources implmentatin) and will be included in 7.0.43 onwards.

-- 
You are receiving this mail because:
You are the assignee for the bug.

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