无法确定合适的驱动程序类别

编程入门 行业动态 更新时间:2024-10-28 06:30:13
本文介绍了无法确定合适的驱动程序类别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

启动应用程序时,看到以下错误:

when starting application, seeing below error:

在上下文初始化期间遇到异常-取消刷新尝试:org.springframework.beans.factory.BeanCreationException:创建名称为'blockDataController'的bean时出错:注入资源依赖项失败; 嵌套的异常是org.springframework.beans.factory.BeanCreationException:创建名称为'blockSummaryImpl'的bean时出错:注入资源依赖项失败;嵌套的异常是org.springframework.beans.factory.UnsatisfiedDependencyException:创建文件[D:\ YueNiuProject \ StockMarket \ yueniu-stock-data \ market-data-dao \ target \ classes \ com \中定义的名称为'prodCodeMapper'的bean时出错yueniu \ stock \ market \ data \ mapper \ block \ ProdCodeMapper.class]:通过bean属性'sqlSessionFactory'表示的不满足的依赖关系; 嵌套的异常是org.springframework.beans.factory.UnsatisfiedDependencyException:在类路径资源[org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]中创建名称为'sqlSessionFactory'的bean时出错:通过方法'sqlSessionFactory'表示的不满足的依赖关系参数0;嵌套的异常是org.springframework.beans.factory.BeanCreationException:创建在类路径资源[org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration $ Hikari.class]中定义的名称为'dataSource'的bean时出错:通过工厂方法实例化Bean失败;嵌套的异常是org.springframework.beans.BeanInstantiationException:无法实例化[com.zaxxer.hikari.HikariDataSource]:工厂方法'dataSource'引发了异常; 嵌套的异常是org.springframework.boot.autoconfigure.jdbc.DataSourceProperties $ DataSourceBeanCreationException:无法确定合适的驱动程序类

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'blockDataController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'blockSummaryImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'prodCodeMapper' defined in file [D:\YueNiuProject\StockMarket\yueniu-stock-data\market-data-dao\target\classes\com\yueniu\stock\market\data\mapper\block\ProdCodeMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Unsatisfied dependency expressed through method 'sqlSessionFactory' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationException: Failed to determine a suitable driver class

推荐答案

与sql数据库的连接,必须在application.properties中配置数据源

the connection with a sql database, you must configure datasource in application.properties

spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.url=jdbc:mysql://.. spring.datasource.username=//.. spring.datasource.password=//..

更多推荐

无法确定合适的驱动程序类别

本文发布于:2023-10-18 23:38:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1505752.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:驱动程序   合适   类别

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!