Exception encountered during context initialization - cancelling refresh attempt: org.

20.263 WARN  o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext:559  restartedMain                    Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'testMapper' defined in file [F:\IDEAJ\wikiproject\target\classes\com\example\wikiproject\mapper\TestMapper.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
20.276 INFO  o.a.c.core.StandardService    :173  restartedMain                    Stopping service [Tomcat]
20.301 INFO  o.s.b.a.l.ConditionEvaluationReportLoggingListener:136  restartedMain                    

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
20.319 ERROR o.s.b.d.LoggingFailureAnalysisReporter:40   restartedMain                    

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class


Action:

Consider the following:
	If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
	If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).


Process finished with exit code 0

 Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'testMapper' defined in file  在项目注入资源依赖的时候报错,刚开始的时候以为是数据库连接的问题,然后重建项目连入数据库,排除数据库连接;然后@注解和scan扫描路径查看,都没有问题,但是配置内容查看也没有问题(上次配置文件留下了坑,)

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
这个错误信息指的是在初始化Spring应用程序上下文时遇到了异常,并且取消了刷新尝试。具体异常类型是`org.springframework.beans.factory.UnsatisfiedDependencyException`。这个异常通常是由于依赖注入失败或者找不到所需的bean导致的。在这个情况下,错误是由`accountService`的注入字段`accountMapper`引起的。根据引用和引用的内容,还有一个与`SqlSessionFactoryBean`有关的错误,这可能是导致依赖注入失败的原因。可能的原因是在创建`SqlSessionFactoryBean` bean时发生了错误。由于引用中提到了`Exception encountered during context initialization`,可能还涉及到了其他的异常。但是由于没有提供完整的错误信息,我无法给出更具体的解决方案。你可以查看完整的错误堆栈跟踪以获取更多细节,并尝试解决这个问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [ Exception encountered during context initialization - cancelling refresh attempt: org.springfram](https://blog.csdn.net/qq_47901630/article/details/128159281)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [spring框架进行简单的增加操作出现的错误,解决方法](https://download.csdn.net/download/IDCSDNS/85772683)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值