You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Phil Steitz (JIRA)" <ji...@apache.org> on 2010/02/15 05:17:28 UTC
[jira] Closed: (DBCP-145) [dbcp] PoolingDriver.getConnectionPool()
should use contextClassLoader
[ https://issues.apache.org/jira/browse/DBCP-145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Phil Steitz closed DBCP-145.
----------------------------
> [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.