commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: dataSource.getConnection fails from within tomcat
Date Sat, 14 Dec 2002 19:04:34 GMT
See below.

On Fri, 13 Dec 2002, James Strachan wrote:

> Date: Fri, 13 Dec 2002 18:00:43 -0000
> From: James Strachan <james_strachan@yahoo.co.uk>
> Reply-To: Jakarta Commons Users List <commons-user@jakarta.apache.org>
> To: Paul Tomsic <ptomsic@yahoo.com>, commons-user@jakarta.apache.org
> Subject: Re: dataSource.getConnection fails from within tomcat
>
> Can anyone spot Pauls problem for him? Could it be a class loading issue?
>
> ----- Original Message -----
> From: "Paul Tomsic" <ptomsic@yahoo.com>
> To: <james_strachan@yahoo.co.uk>
> Sent: Friday, December 13, 2002 5:55 PM
> Subject: dataSource.getConnection fails from within tomcat
>
> > James,
> >
> > we exchanged a few emails a while ago about a
> > persistence problem that I was having from within
> > tomcat.
> > Sorry to email you directly, but I'm not having any
> > success getting answers from the mailing list, so I
> > thought I'd take a chance and ask you directly.
> > Again, my apologies, but I can't seem to correct this
> > problem.
> >
> > I'm able to connect to a MySQL dB using a stand alone
> > file (see below), but when I put the exact same code
> > into our application from within Tomcat, I get a
> > nullPointer on the
> > conn = dataSource.getConnection()
> > line.
> >
> > you wouldn't have any thoughts as to why this is
> > happening, or even a suggestion as to where I could
> > start troubleshooting, would you?
> > It's just odd that I can do it stand-alone, but when
> > mixed w/ Tomcat, I get that nullpointer, but no real
> > explaination.
> >
> >
> > thanks again, and sorry for the direct email bother.
> >
> > ---stack trace and code from within tomcat----
> > ----code from within tomcat----
> > System.setProperty("jdbc.drivers",
> > "com.mysql.jdbc.Driver");
> > GenericObjectPool connectionPool = new
> > GenericObjectPool(null);
> > ConnectionFactory connectionFactory = new
> >
> DriverManagerConnectionFactory("jdbc:mysql://10.117.7.18:3306/dow?autoReconn
> ect=true",
> > "user", "pass");
> > connectionPool.setMaxActive(10);
> > connectionPool.setMaxIdle(10);
> > connectionPool.setMaxWait(10);
> >
> > PoolableConnectionFactory poolableConnectionFactory
> > = new PoolableConnectionFactory(connectionFactory,
> > connectionPool, null, null, false, true);
> > PoolingDriver driver = new PoolingDriver();
> > driver.registerPool("dow", connectionPool);
> > Connection conn =
> > DriverManager.getConnection("jdbc:apache:commons:dbcp:dow");
> >

This does not appear to be a JDBC URL that any driver I know of would
recognize.

> > ----stack trace of error--------
> > org.apache.commons.dbcp.DbcpException:
> > java.sql.SQLException: No suitable driver

That's exactly the exception I would expect from the URL noted above.

Craig


Mime
View raw message