ApplicationContext is unlikely to start due to a @ComponentScan of the default package

简介: 解决办法:1、一般发出这个警告的原因是你把启动类直接放在的src目录下面。2、你需要在src目录下面再建一个包,然后把启动类放到下面。3、或者你错将启动类放到java文件中了,与项目包成了同级文件,你只需要将启动类放到项目包里就可以。

springboot警告:ApplicationContext is unlikely to start due to a @ComponentScan of the default package


解决办法:

1、一般发出这个警告的原因是你把启动类直接放在的src目录下面。

2、你需要在src目录下面再建一个包,然后把启动类放到下面。

3、或者你错将启动类放到java文件中了,与项目包成了同级文件,你只需要将启动类放到项目包里就可以。

20200718203517476.jpg

相关文章
|
NoSQL Redis
Consider defining a bean of type ‘com.bsj.system.service.RedisService‘ in your configuration
Consider defining a bean of type ‘com.bsj.system.service.RedisService‘ in your configuration
570 0
|
6月前
|
搜索推荐 Java 开发者
org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException 问题处理
【5月更文挑战第14天】org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException 问题处理
584 1
IDEA添加Swagger2:Parameter 0 of method linkDiscoverers in org. springframework hateoas.config.Hateoasconfiguration required a single bean, but 15 were found:
IDEA添加Swagger2:Parameter 0 of method linkDiscoverers in org. springframework hateoas.config.Hateoasconfiguration required a single bean, but 15 were found
|
3月前
|
Java Maven
Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
65 0
|
消息中间件 Java RocketMQ
【Java】Error creating bean with name ‘functionBindingRegistrar‘ defined in class path resource的一种解决方式
【Java】Error creating bean with name ‘functionBindingRegistrar‘ defined in class path resource的一种解决方式
142 0
|
druid
A bean with that name has already been defined in class path resource and overriding is disabled.
A bean with that name has already been defined in class path resource and overriding is disabled.
219 0
|
Java 应用服务中间件
严重: Exception sending context destroyed event to listener instance of class org.springframework.web.
严重: Exception sending context destroyed event to listener instance of class org.springframework.web.
291 0
严重: Exception sending context destroyed event to listener instance of class org.springframework.web.
|
Nacos
Nacos报错:Error creating bean with name ‘authFilterRegistration‘ defined in class path resource
Nacos报错:Error creating bean with name ‘authFilterRegistration‘ defined in class path resource
483 0
|
Java 数据库连接 网络安全
Error creating bean with name ‘attrAttrgroupRelationController‘
Error creating bean with name ‘attrAttrgroupRelationController‘
Error creating bean with name ‘attrAttrgroupRelationController‘
|
Java API Spring
A component required a bean named xxx that could not be found
A component required a bean named xxx that could not be found
A component required a bean named xxx that could not be found