java - ClassNotFoundException: org.springframework.jdbc.datasource.DriverManagerDataSource -
i trying basic database operations. i'm using sts 3.2.0, apache tomcat 7.
my dispatcher-servlet.xml includes:
<bean id="datasource" class="org.springframework.jdbc.datasource.drivermanagerdatasource"> <property name="driverclassname" value="com.mysql.jdbc.driver" /> <property name="url" value="jdbc:mysql://localhost:3306/mydb" /> <property name="username" value="root" /> <property name="password" value="root" /> </bean>
apache tomcat fails miserably thousands of exceptions, starting 1 :
org.springframework.beans.factory.beancreationexception: error creating bean name 'org.springframework.web.servlet.mvc.annotation.defaultannotationhandlermapping#0': initialization of bean failed; nested exception org.springframework.beans.factory.cannotloadbeanclassexception: cannot find class [org.springframework.jdbc.datasource.drivermanagerdatasource] bean name 'datasource' defined in servletcontext resource [/web-inf/dispatcher-servlet.xml]; nested exception java.lang.classnotfoundexception: org.springframework.jdbc.datasource.drivermanagerdatasource related cause: org.springframework.beans.factory.cannotloadbeanclassexception: cannot find class [org.springframework.jdbc.datasource.drivermanagerdatasource] bean name 'datasource' defined in servletcontext resource [/web-inf/dispatcher-servlet.xml]; nested exception java.lang.classnotfoundexception: org.springframework.jdbc.datasource.drivermanagerdatasource
edit 1: downloaded 3.0.3.release version of jar, , still same.
final edit seems, should add external jar files manually deployment directory (well if don't use extension that'd you)
try add pom.xml:
<dependency> <groupid>org.springframework</groupid> <artifactid>spring-jdbc</artifactid> <version>3.0.3.release</version> </dependency>
Comments
Post a Comment