Subject | Re: Java: Cannot get a connection, pool exhausted |
---|---|
Author | Luke Young |
Post date | 2007-03-07T15:27:55Z |
Of all the silly things...
I was testing the connection with SELECT 1
That was the error.
Thanks for your help Roman
--- In Firebird-Java@yahoogroups.com, Roman Rokytskyy <rrokytskyy@...>
wrote:
I was testing the connection with SELECT 1
That was the error.
Thanks for your help Roman
--- In Firebird-Java@yahoogroups.com, Roman Rokytskyy <rrokytskyy@...>
wrote:
>"DatabaseURL" ) );
> > I am using my web.xml file to configure the driver and using the
> > settings mentioned:
> >
> > I am using this driver:
> >
> > org.firebirdsql.jdbc.FBDriver
>
> Where did you put the jar file? BTW, what version do you use?
>
> > And this Database URL:
> >
> > jdbc:firebirdsql:localhost/3050:C:\\Subfolder\\Subfolder\\THEDB.FDB
> >
> > I believe this to be correct and I also believe that the server is
> > running.
>
> Ok.
>
> > The following code is used to make the connection:
> >
> > DatabaseConfig databaseConfig = new DatabaseConfig();
> > databaseConfig.setDriver( getInitParameter( "Driver" ) );
> > databaseConfig.setDatabaseURL( getInitParameter(
> > databaseConfig.setUsername( getInitParameter( "Username" ) );null).
> > 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
>
> Can you try to hardcode the values first? Or check in debugger that
> getInitParameter(...) calls return correct values?
>
> > But when I call the getConnection() I get the following errors:
> >
> > org.apache.commons.dbcp.SQLNestedException: Cannot get a connection,
> > pool exhausted, cause:
> > java.util.NoSuchElementException: Could not create a validated object
> > at
>
> Is that the only stack trace you have in the error log/console?
>
> 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
>