启动springboot提示o.s.b.d.LoggingFailureAnalysisReporter

各位大佬,我是小白,正在自学,跟着视频一步一步做,在IDEA启动springboot服务的时候失败,提示o.s.b.d.LoggingFailureAnalysisReporter,上网查询,说是修改@SpringBootApplication等方法,试了也不管用。请问该怎么解决?

异常信息


:: Spring Boot ::                (v2.5.6)

2021-11-26 10:38:18.350  INFO 11944 --- [           main] c.l.s.SpringboottestApplication          : Starting SpringboottestApplication using Java 1.8.0_191 on lousp-PC with PID 11944 (D:\7、开发\springboottest\target\classes started by Administrator in D:\7、开发\springboottest)
2021-11-26 10:38:18.353  INFO 11944 --- [           main] c.l.s.SpringboottestApplication          : No active profile set, falling back to default profiles: default
2021-11-26 10:38:19.202  INFO 11944 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8181 (http)
2021-11-26 10:38:19.210  INFO 11944 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2021-11-26 10:38:19.210  INFO 11944 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.54]
2021-11-26 10:38:19.317  INFO 11944 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2021-11-26 10:38:19.317  INFO 11944 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 914 ms
2021-11-26 10:38:19.361  WARN 11944 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bookHandler': Unsatisfied dependency expressed through field 'bookRepository'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.lousp.springboottest.repository.BookRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
2021-11-26 10:38:19.363  INFO 11944 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2021-11-26 10:38:19.376  INFO 11944 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-11-26 10:38:19.394 ERROR 11944 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

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

Description:

Field bookRepository in com.lousp.springboottest.controller.BookHandler required a bean of type 'com.lousp.springboottest.repository.BookRepository' that could not be found.

The injection point has the following annotations:
	- @org.springframework.beans.factory.annotation.Autowired(required=true)


Action:

Consider defining a bean of type 'com.lousp.springboottest.repository.BookRepository' in your configuration.


Process finished with exit code 1

把异常得日志信息发出来。


:: Spring Boot ::                (v2.5.6)

2021-11-26 10:38:18.350  INFO 11944 --- [           main] c.l.s.SpringboottestApplication          : Starting SpringboottestApplication using Java 1.8.0_191 on lousp-PC with PID 11944 (D:\7、开发\springboottest\target\classes started by Administrator in D:\7、开发\springboottest)
2021-11-26 10:38:18.353  INFO 11944 --- [           main] c.l.s.SpringboottestApplication          : No active profile set, falling back to default profiles: default
2021-11-26 10:38:19.202  INFO 11944 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8181 (http)
2021-11-26 10:38:19.210  INFO 11944 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2021-11-26 10:38:19.210  INFO 11944 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.54]
2021-11-26 10:38:19.317  INFO 11944 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2021-11-26 10:38:19.317  INFO 11944 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 914 ms
2021-11-26 10:38:19.361  WARN 11944 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bookHandler': Unsatisfied dependency expressed through field 'bookRepository'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.lousp.springboottest.repository.BookRepository' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
2021-11-26 10:38:19.363  INFO 11944 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2021-11-26 10:38:19.376  INFO 11944 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-11-26 10:38:19.394 ERROR 11944 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

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

Description:

Field bookRepository in com.lousp.springboottest.controller.BookHandler required a bean of type 'com.lousp.springboottest.repository.BookRepository' that could not be found.

The injection point has the following annotations:
	- @org.springframework.beans.factory.annotation.Autowired(required=true)


Action:

Consider defining a bean of type 'com.lousp.springboottest.repository.BookRepository' in your configuration.


Process finished with exit code 1

这个类没有被找到。你是用的JPA吗?检查一下你的配置,可能整合有问题。

感谢!现在好了!刚才我又run了一次,提示8181端口被占用,我解除占用就好了。一开始提示的不是端口占用问题。。。莫名其妙,我这个新手被弄晕了

不急,慢慢来。这不难。