Reputation: 7651
I am using apache-tomcat-6.0.37, spring 2.5.6 and tomcat-jdbc-7.0.19.When configuring org.apache.tomcat.jdbc.pool.DataSource in xml file, I am getting this error:
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.tomcat.jdbc.pool.DataSource].
Does spring 2.5.6 does not support tomcat-jdbc-7.0.19? Do it need higher version of spring? At this current moment I can not shift to higher version. Do I need to get conform?
Upvotes: 0
Views: 1154
Reputation: 7651
The problem is solved .Though the class path of jar was present in .class file generated by ecclipse .I have forgotten to include in build.xml.So the jar was missing in lib of tomcat.
Upvotes: 0
Reputation: 18415
Your JARs are outdated first of all.
$CATALINA_*/lib
and nowhere else (*
== HOME
or BASE
)DataSource
in your context.xml
DataSource
from your beans.xml
with a JNDI lookupTomcat JDBC Pool works flawlessly with Tomcat 6 as long as your run Java 6.
Here is a very similar question.
Upvotes: 0
Reputation: 4123
Right now the error you are getting is Cannot find class, this means that the following class is not in the classpath. You should check if jar is present in classpath or not.
Probable location (Since it doesn't get shipped with tomcat-6.x):
By reading from the documentation, I guess tomcat-jdbc is something introduced in tomcat-7.x not in tomcat-6.x so I doubt if it will work as expected.
Link of interest: http://people.apache.org/~fhanik/jdbc-pool/jdbc-pool.html
Upvotes: 1
Reputation: 263
These two stack overflow links will solve your problems.
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class
Spring Web App - CannotLoadBeanClassException caused by Java.lang.ClassNotFoundException
Upvotes: 0