[
https://issues.apache.org/jira/browse/DBCP-365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13112856#comment-13112856
]
Axl commented on DBCP-365:
--------------------------
Hi this turns out to be a permissions issue on the .jar files. The improvement
I would like to see is, added logging for Class.forName(), or added handling of
Throwable instead of only Exceptions. Looking at the source I see handling of
exceptions however errors are not caught. So whatever your recommendation would
be here. Could for example wrap all Class.forName() calls. Or a larger effort
would be catching Throwable everywhere. This could be made lower priority,
unless it turns out others are experiencing this issue. Whatever you think, I
don't do all that much Java so it's your call.
> StackOverflowError SharedPoolDataSource.getPooledConnectionAndInfo()
> Postgresql
> -------------------------------------------------------------------------------
>
> Key: DBCP-365
> URL: https://issues.apache.org/jira/browse/DBCP-365
> Project: Commons Dbcp
> Issue Type: Bug
> Affects Versions: 1.4
> Environment: Windows XP 64-bit multi-threaded
> Reporter: Axl
> Labels: JDBC, postgresql
>
> This might be a problem with the JDBC driver for PostgreSQL 9.1 but it also
> shows up here. Since this is a StackOverflowError there isn't much
> information about what specifically is causing this. I'm guessing it's a
> Class.forName() for one of the org.postgresql.* classes but not sure which
> one. The Class.forName() goes into a loop which throws the StackOverflowError.
> SharedPoolDataSource.getPooledConnectionAndInfo(String, String) line: 174
> SharedPoolDataSource(InstanceKeyDataSource).getConnection(String, String)
> line: 701
> SharedPoolDataSource(InstanceKeyDataSource).getConnection() line: 676
> spds = new
> org.apache.commons.dbcp.datasources.SharedPoolDataSource();
> cpds = new
> org.apache.commons.dbcp.cpdsadapter.DriverAdapterCPDS();
> cpds.setDriver("org.postgresql.Driver");
>
> cpds.setUrl("jdbc:postgresql://localhost:1234/mydatabasename");
> cpds.setUser("myuser");
> cpds.setPassword("mypass");
> spds.setConnectionPoolDataSource(cpds);
> spds.setMaxActive(30);
> spds.setMaxWait(50);
>
> conn = spds.getConnection();
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira