Subject | Re: [Firebird-Java] Re: Java: Cannot get a connection, pool exhausted |
---|---|
Author | Roman Rokytskyy |
Post date | 2007-03-07T14:08:50Z |
> I am using my web.xml file to configure the driver and using theWhere did you put the jar file? BTW, what version do you use?
> settings mentioned:
>
> I am using this driver:
>
> org.firebirdsql.jdbc.FBDriver
> And this Database URL:Ok.
>
> jdbc:firebirdsql:localhost/3050:C:\\Subfolder\\Subfolder\\THEDB.FDB
>
> I believe this to be correct and I also believe that the server is
> running.
> The following code is used to make the connection:Can you try to hardcode the values first? Or check in debugger that
>
> DatabaseConfig databaseConfig = new DatabaseConfig();
> databaseConfig.setDriver( getInitParameter( "Driver" ) );
> databaseConfig.setDatabaseURL( getInitParameter( "DatabaseURL" ) );
> databaseConfig.setUsername( getInitParameter( "Username" ) );
> databaseConfig.setPassword( getInitParameter( "Password" ) );
> databaseConfig.setInitialconnections( convertToInt(
> getInitParameter( "Initialconnections" ) ) );
> databaseConfig.setMaxconnections( convertToInt(
> getInitParameter( "Maxconnections" ) ) );
>
> dataSource = getDataSource( databaseConfig );
>
>
> And the last line is producing a dataSource object (well it is not null).
getInitParameter(...) calls return correct values?
> But when I call the getConnection() I get the following errors:Is that the only stack trace you have in the error log/console?
>
> org.apache.commons.dbcp.SQLNestedException: Cannot get a connection,
> pool exhausted, cause:
> java.util.NoSuchElementException: Could not create a validated object
> at
The issue is that it only tells that DBCP had some problem to create a
connection, but it is not clear why:
- did it find the driver in the classpath?
- did it have all properties correctly configured?
- did the driver return an error when connecting?
Roman