blueloveypx 2017-11-24 02:50 采纳率: 0%
浏览 872

想要进行spring+springMVC+Hibernate整合,启动tomcat的时候发生了错误

警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'studentController': Unsatisfied dependency expressed through field 'studentService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'studentService': Unsatisfied dependency expressed through field 'studentDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'studentDAO': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.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 class path resource [applicationContext.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 [com.mysql.jdbc.Driver]

  • 写回答

3条回答

  • HryReal 2017-11-24 03:00
    关注

    下面说Could not load JDBC driver class [com.mysql.jdbc.Driver]
    可能是你的mysql连接的包没有导进来

    1.在项目properties->buildPath 的library中看看有没有mysql-connector-java-x.x.x-bin.jar

    2.如果没有就下载mysql-connector-java-x.x.x-bin.jar

    3. properties->buildPath 的library,在“库”选项卡中,选择“添加外部JAR”,找到下载的mysql-connector-java-5.1.22-bin.jar文件,将其添加进项目。
    
    评论

报告相同问题?

悬赏问题

  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用