commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 32964] New: - PoolingDriver.getConnectionPool() should use contextClassLoader
Date Thu, 06 Jan 2005 14:55:25 GMT
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=32964>.
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=32964

           Summary: PoolingDriver.getConnectionPool() should use
                    contextClassLoader
           Product: Commons
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Dbcp
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: jfrantzius@web.de


[commons-dbcp.jar 1.2.1]

In PoolingDriver.getConnectionPool(String), the following is used:

InputStream in = this.getClass().getResourceAsStream(String.valueOf(name) +
".jocl");

In certain environments, this will fail to find the resource. In particular the
Eclipse Rich Client Platform, i.e. Eclipse's Plugin classloader architecture,
prevent this from working, but this might apply for some application servers as
well. It is generally common (and recommandable) to use the current Thread's
contextClassLoader instead, e.g. by following the above line with:

if (in==null) {
   in =
Thread.currentThread().getContextClassLoader().getResourceAsStream(String.valueOf(name)
+ ".jocl");
}

Thanks,
Jörg.

-- 
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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message