commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Thomas (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (DBCP-145) [dbcp] PoolingDriver.getConnectionPool() should use contextClassLoader
Date Sun, 15 Mar 2009 22:34:50 GMT

     [ https://issues.apache.org/jira/browse/DBCP-145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Mark Thomas resolved DBCP-145.
------------------------------

    Resolution: Fixed

Jörg thanks for your suggested patch. It has been applied.

> [dbcp] PoolingDriver.getConnectionPool() should use contextClassLoader
> ----------------------------------------------------------------------
>
>                 Key: DBCP-145
>                 URL: https://issues.apache.org/jira/browse/DBCP-145
>             Project: Commons Dbcp
>          Issue Type: Improvement
>         Environment: Operating System: Windows XP
> Platform: PC
>            Reporter: Jörg von Frantzius
>            Priority: Minor
>             Fix For: 1.3
>
>
> [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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message