You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by dunnlow <du...@yahoo.com> on 2011/04/20 15:38:16 UTC

Why can't Tomcat find class org.apache.tomcat.jdbc.pool DataSourceFactory?

So, I'm investigating moving away from an oracleconnectionpool and using the
tomcat connection pool.  I followed the myriad of examples for configuring
the Resource in the server.xml.  Found great info here
(http://people.apache.org/~fhanik/tomcat/jdbc-pool.html) However, when I
start tomcat, I get the following error: 

javax.naming.NamingException: Could not load resource factory class [Root
exception is java.lang.ClassNotFoundException: org.apache.tomcat.jdbc.pool
DataSourceFactory] 

I'm using Tomcat 6.0 

My config in server.xml is 
<Resource auth="Container" driverClassName="oracle.jdbc.OracleDriver"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" name="jdbc/myds"
password="mypasswd" type="javax.sql.DataSource"
url="jdbc:oracle:thin:@10.10.10.33:1234:myds" user="myuname" /> 

I get it, tomcat can't find the class.  But WHY?  I don't see anything in
the documentation about adding extra .jar files.  I've looked in the distrib
and can find the golden .jar anyway. 

Can anyone tell me what I am doing wrong? 

Thanks!
-- 
View this message in context: http://old.nabble.com/Why-can%27t-Tomcat-find-class-org.apache.tomcat.jdbc.pool-DataSourceFactory--tp31441243p31441243.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Why can't Tomcat find class org.apache.tomcat.jdbc.pool DataSourceFactory?

Posted by dunnlow <du...@yahoo.com>.
Thanks Filip.  So this is not part of the standard Tomcat distribution? 
Sorry, I don't really understand Apache I guess.  I see this code is under
the people.apache.org user fhanik.  It looks like it has been around for two
years.  But, at the risk of sounding ungrateful, is this code to be trusted
(for a production system)?  

Also, the documentation I see there shows Tomcat 7 but I'm using Tomcat 6. 
Any idea if there is an issue?

Thanks again.


Filip Hanik - Dev Lists wrote:
> 
> download tomcat-jdbc.jar from
> http://people.apache.org/~fhanik/jdbc-pool/
> and put it in your lib directory
> Filip
> 
> On 4/20/2011 7:38 AM, dunnlow wrote:
>> So, I'm investigating moving away from an oracleconnectionpool and using
>> the
>> tomcat connection pool.  I followed the myriad of examples for
>> configuring
>> the Resource in the server.xml.  Found great info here
>> (http://people.apache.org/~fhanik/tomcat/jdbc-pool.html) However, when I
>> start tomcat, I get the following error:
>>
>>8<
> 

-- 
View this message in context: http://old.nabble.com/Why-can%27t-Tomcat-find-class-org.apache.tomcat.jdbc.pool-DataSourceFactory--tp31441243p31449093.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Why can't Tomcat find class org.apache.tomcat.jdbc.pool DataSourceFactory?

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
download tomcat-jdbc.jar from
http://people.apache.org/~fhanik/jdbc-pool/
and put it in your lib directory
Filip

On 4/20/2011 7:38 AM, dunnlow wrote:
> So, I'm investigating moving away from an oracleconnectionpool and using the
> tomcat connection pool.  I followed the myriad of examples for configuring
> the Resource in the server.xml.  Found great info here
> (http://people.apache.org/~fhanik/tomcat/jdbc-pool.html) However, when I
> start tomcat, I get the following error:
>
> javax.naming.NamingException: Could not load resource factory class [Root
> exception is java.lang.ClassNotFoundException: org.apache.tomcat.jdbc.pool
> DataSourceFactory]
>
> I'm using Tomcat 6.0
>
> My config in server.xml is
> <Resource auth="Container" driverClassName="oracle.jdbc.OracleDriver"
> factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" name="jdbc/myds"
> password="mypasswd" type="javax.sql.DataSource"
> url="jdbc:oracle:thin:@10.10.10.33:1234:myds" user="myuname" />
>
> I get it, tomcat can't find the class.  But WHY?  I don't see anything in
> the documentation about adding extra .jar files.  I've looked in the distrib
> and can find the golden .jar anyway.
>
> Can anyone tell me what I am doing wrong?
>
> Thanks!


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Why can't Tomcat find class org.apache.tomcat.jdbc.pool DataSourceFactory?

Posted by dunnlow <du...@yahoo.com>.
Barry,
I've read the the oracle.jdbc.driver.OracleDriver is depricated (I tried it
anyway though with no luck).  I think I know the error to which you refer
having the jar in both places (creates different classes), but that isn't it
either.  Filip pointed me to (http://people.apache.org/~fhanik/jdbc-pool/)
which has the .jar it looks like I need.  But, I'm worried about the safety
of using code that is outside normal distribution in a production system. 
Any thoughts?
Thanks.


Propes, Barry L wrote:
> 
> Dunlow, I have this in mine (driver attribute)
> 
>  driverClassName="oracle.jdbc.driver.OracleDriver"
> 
> But also, it could be that you've got the oracle jdbc jar file in more
> than one directory.
> 
> That happened to me and I was getting very unstable error messages I could
> not account for, and it was related to this.
> 
> Earlier Tomcat versions were more forgiving, but not the 6.0. series.
> 
> Try that and let us know.
> 
> -----Original Message-----
> From: dunnlow [mailto:dunnlow@yahoo.com] 
> Sent: Wednesday, April 20, 2011 8:38 AM
> To: users@tomcat.apache.org
> Subject: Why can't Tomcat find class org.apache.tomcat.jdbc.pool
> DataSourceFactory?
> 
> 
> So, I'm investigating moving away from an oracleconnectionpool and using
> the tomcat connection pool.  I followed the myriad of examples for
> configuring the Resource in the server.xml.  Found great info here
> (http://people.apache.org/~fhanik/tomcat/jdbc-pool.html) However, when I
> start tomcat, I get the following error: 
> 
> javax.naming.NamingException: Could not load resource factory class [Root
> exception is java.lang.ClassNotFoundException: org.apache.tomcat.jdbc.pool
> DataSourceFactory] 
> 
> I'm using Tomcat 6.0 
> 
> My config in server.xml is
> <Resource auth="Container" driverClassName="oracle.jdbc.OracleDriver"
> factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" name="jdbc/myds"
> password="mypasswd" type="javax.sql.DataSource"
> url="jdbc:oracle:thin:@10.10.10.33:1234:myds" user="myuname" /> 
> 
> I get it, tomcat can't find the class.  But WHY?  I don't see anything in
> the documentation about adding extra .jar files.  I've looked in the
> distrib and can find the golden .jar anyway. 
> 
> Can anyone tell me what I am doing wrong? 
> 
> Thanks!
> --
> View this message in context:
> http://old.nabble.com/Why-can%27t-Tomcat-find-class-org.apache.tomcat.jdbc.pool-DataSourceFactory--tp31441243p31441243.html
> Sent from the Tomcat - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Why-can%27t-Tomcat-find-class-org.apache.tomcat.jdbc.pool-DataSourceFactory--tp31441243p31450321.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Why can't Tomcat find class org.apache.tomcat.jdbc.pool DataSourceFactory?

Posted by "Propes, Barry L " <ba...@citi.com>.
Dunlow, I have this in mine (driver attribute)

 driverClassName="oracle.jdbc.driver.OracleDriver"

But also, it could be that you've got the oracle jdbc jar file in more than one directory.

That happened to me and I was getting very unstable error messages I could not account for, and it was related to this.

Earlier Tomcat versions were more forgiving, but not the 6.0. series.

Try that and let us know.

-----Original Message-----
From: dunnlow [mailto:dunnlow@yahoo.com] 
Sent: Wednesday, April 20, 2011 8:38 AM
To: users@tomcat.apache.org
Subject: Why can't Tomcat find class org.apache.tomcat.jdbc.pool DataSourceFactory?


So, I'm investigating moving away from an oracleconnectionpool and using the tomcat connection pool.  I followed the myriad of examples for configuring the Resource in the server.xml.  Found great info here
(http://people.apache.org/~fhanik/tomcat/jdbc-pool.html) However, when I start tomcat, I get the following error: 

javax.naming.NamingException: Could not load resource factory class [Root exception is java.lang.ClassNotFoundException: org.apache.tomcat.jdbc.pool DataSourceFactory] 

I'm using Tomcat 6.0 

My config in server.xml is
<Resource auth="Container" driverClassName="oracle.jdbc.OracleDriver"
factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" name="jdbc/myds"
password="mypasswd" type="javax.sql.DataSource"
url="jdbc:oracle:thin:@10.10.10.33:1234:myds" user="myuname" /> 

I get it, tomcat can't find the class.  But WHY?  I don't see anything in the documentation about adding extra .jar files.  I've looked in the distrib and can find the golden .jar anyway. 

Can anyone tell me what I am doing wrong? 

Thanks!
--
View this message in context: http://old.nabble.com/Why-can%27t-Tomcat-find-class-org.apache.tomcat.jdbc.pool-DataSourceFactory--tp31441243p31441243.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org