首页 文章

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

提问于
浏览
0

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

在上下文初始化期间遇到异常 - 取消刷新尝试: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:在类路径资源中定义名称为'dataSource'的bean时出错[org / springframework / boot / autoconfigure / jdbc / DataSourceConfiguration $ Hikari.class]:通过工厂方法进行Bean实例化失败;嵌套异常是org.springframework.beans.BeanInstantiationException:无法实例化[com.zaxxer.hikari.HikariDataSource]:工厂方法'dataSource'抛出异常;嵌套异常是org.springframework.boot.autoconfigure.jdbc.DataSourceProperties $ DataSourceBeanCreationException:无法确定合适的驱动程序类

1 回答

  • 0

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

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

相关问题