admin管理员组

文章数量:1566601

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扫描路径查看,都没有问题,但是配置内容查看也没有问题(上次配置文件留下了坑,)

 

 

本文标签: ContextinitializationExceptionencounteredattempt