我参考了网上的一个实例,用springmvc+hibernate做了一个例子,把原来它配的oracle换成了SQLserver出错
Causedby:org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwit...
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [D:\win7-myeclipse\apache-tomcat-7.0.62\wtpwebapps\springmvc12\WEB-INF\classes\config\springAnnotation-hibernate.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in file [D:\win7-myeclipse\apache-tomcat-7.0.62\wtpwebapps\springmvc12\WEB-INF\classes\config\springAnnotation-hibernate.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [oracle.jdbc.driver.OracleDriver]
org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions 展开
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [oracle.jdbc.driver.OracleDriver]
org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询