报错: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userController': Unsatisfied dependency expressed through field 'userDao'; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.jdbc.dataSource.DataSourceTransactionManager] for bean with name 'txManager' defined in class path resource [applicationContext.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.jdbc.dataSource.DataSourceTransactionManager
记录一下,纯属自己犯傻
如果加了 spring-jdbc的jar包还报这个错时可能是applicationContext.xml里出错,到applicationContext.xml里面按住ctrl逐个点击[org.springframework.jdbc.dataSource.DataSourceTransactionManager]从哪里不能跳到对应文件就从哪里开始删除后再打进去,中途跳出来的文件夹点击加进去就可以了。



