tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Nicholson" <...@email.unc.edu>
Subject Re: dataSource.getConnection only fails from within tomcat
Date Thu, 12 Dec 2002 19:34:00 GMT
I'm absolutely guessing (meaning I haven't used it or thought much about
it), but I'd guess it's some sort of classloader issue.  Do you have the
driver classes in multiple places, or, if you have the driver classes
jar'ed, are some other classes in the same jar, preventing them from being
loades? (a la classes12.jar from oracle, which came with something like
javax.servlet classes or something bizarre...).

Sorry I don't have a real answer for you...

----- Original Message -----
From: "Paul Tomsic" <ptomsic@yahoo.com>
To: <tomcat-user@jakarta.apache.org>
Sent: Thursday, December 12, 2002 2:14 PM
Subject: dataSource.getConnection only fails from within tomcat


> could someone guess as to why I can connect to our DB
> (MySQL) from a standalone application (single, java
> file using a Main()) successfully using the below
> code, but when I try to do it from within Tomcat, it
> fails w/ a nullpointer?
>
> thanks -
>
> GenericObjectPool connectionPool = new GenericObjectPo
> ol(null);
> ObjectPool connectionPool = new
> GenericObjectPool(null);
> ConnectionFactory connectionFactory = new
>
DriverManagerConnectionFactory("jdbc:mysql://10.117.7.18:3306/dow?autoReconn
ect=true",
> "user", "pwd");
> PoolableConnectionFactory poolableConnectionFactory =
> new PoolableConnectionFactory(connectionFactory,
> connectionPool, null, null, false, true);
> PoolingDataSource dataSource = new
> PoolingDataSource(connectionPool);
> // nullpointerexception on the next line
> conn = dataSource.getConnection();
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>
> --
> To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message