因默认包扫描问题导致的SpringBoot项目无法启动问题
启动SpringBoot项目的时候,提示如下信息:
-- ::22.255 INFO --- [ main] s.c.a.AnnotationConfigApplicationContext :
Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@4e3958e7:
startup date [Mon Aug :: CST ]; root of context hierarchy
-- ::22.817 INFO --- [ main] f.a.AutowiredAnnotationBeanPostProcessor :
JSR- 'javax.inject.Inject' annotation found and supported for autowiring
-- ::22.864 INFO --- [ main] trationDelegate$BeanPostProcessorChecker :
Bean 'configurationPropertiesRebinderAutoConfiguration' of type
[class org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$105a6ef0]
is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) . ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.4.2.RELEASE) -- ::23.551 INFO --- [ main] EurekaServerMasterApplication :
No active profile set, falling back to default profiles: default
-- ::23.567 INFO --- [ main] ationConfigEmbeddedWebApplicationContext :
Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@12c7a01b:
startup date [Mon Aug :: CST ];
parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@4e3958e7
-- ::23.582 WARN --- [ main] ionWarningsApplicationContextInitializer : ** WARNING ** : Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.
解决办法:
把main方法所在的类放到一个自定义的包路径下,而不能直接放在mian/java路径下。
下面是错误的位置:

下面是正确的位置:

如果本文对您有所帮助,请扫描下方微信二维码打赏,您的鼓励是我前进最大的鼓励!

因默认包扫描问题导致的SpringBoot项目无法启动问题的更多相关文章
- SpringBoot项目快速启动停止脚本
SpringBoot项目快速启动停止脚本 1.在jar包同级目录下,创建 app.sh #!/bin/bash appName=`ls|grep .jar$` if [ -z $appName ] t ...
- springboot项目突然启动缓慢
在项目快到最后的时候,有一次在本地启动项目的时候,突然发现项目启动起来特别的慢. 刚开始也不知道哪里出了问题,只能慢慢的查原因. springboot项目在debug模式下本来运行的挺快,后来某一天突 ...
- SpringBoot项目jar启动端口设置
SpringBoot项目打包后,在target下生成的jar文件可以使用 Java - jar 直接启动,指定端口号配置 java -jar epjs-eureka.jar --server.port ...
- SpringBoot -- 项目结构+启动流程
一.简述: 项目结构 二.简述:启动流程 说springboot的启动流程,当然少不了springboot启动入口类 @SpringBootApplication public class Sprin ...
- eclipse中创建的spring-boot项目在启动时指定加载那一个配置文件的设置
步骤如下:鼠标点击项目右键—>Run As—>Run Configurations—>Java Application (如下图) 鼠标右键点击Java Application——— ...
- springboot项目简单启动脚本
#!/bin/bash function log_info () { DATE=`date "+%Y-%m-%d %H:%M:%S"` USER=$(whoami) echo &q ...
- IDEA导入springboot项目不能启动
由于工具没有识别到项目的pom.xml文件,所以需要在右侧的Maven栏目中点击 + 号,选中项目的pom.xml文件,则导入成功.
- 【排错】springboot项目,启动报An attempt was made to call the method com.google.gson.GsonBuilder.setLenient()Lcom/google/gson/GsonBuilder; but it does not exist.
pom文件新引入: <dependency> <groupId>com.google.code.gson</groupId> ...
- SpringBoot包扫描之多模块多包名扫描和同类名扫描冲突解决
前言 我们在开发springboot项目时候,创建好SpringBoot项目就可以通过启动类直间启动,运行一个web项目,非常方便简单,不像我们之前通过Spring+SpringMvc要运行启动一个w ...
随机推荐
- 树莓派进阶之路 (016) - 通过595驱动4位LED显示系统时间
模块图片,4位共阳极数码管. 我们使用树莓派wiringPi的库来通过74HC595驱动4位数码管: C 代码如下: #include <wiringPi.h> #include < ...
- openstack nova 深入
一.概述: 由nova --debug list查看到: #nova --debug list DEBUG (session:195) REQ: curl -g -i -X GET http://19 ...
- 【Eclipse】Eclipse如何如何集成Tomcat服务器
需要的环境 下载和配置JDK 读者可参见JDK的安装与配置 下载和配置Tomcat 读者可参见Tomcat的下载和配置 下载Eclipse 读者可参见Eclipse官方网站 Eclipse 4.4.0 ...
- mac下 cordova 搭建
最近遇到一个cordova搭建的项目,于是看了看如何搭建这个. 这个其实 和 phoneGap 差不多,都是为了方便html跨平台才产生的产物. cordova 也可以生成 iOS 和 安卓 ...
- Spring Cloud问题分析
基于Spring Cloud框架开发时,经常会碰到各种开发问题,那么碰到这些问题时如何去解决呢?下面描述基于Spring Cloud问题定位的基本思路,大概可以分为如下几步: 排查配置问题 环境问题 ...
- golang 学习笔记 ---Sizeof
unsafe.Sizeof浅析 package main import "unsafe" import "fmt" func main() { slice := ...
- Unable to convert MySQL date/time value to System.DateTime
当使用.NET connector 连接MYSQL数据库,检索某些数据的时候,你可能会得到一个错误信息: "Unable to convert MySQL date/time value t ...
- mvc 缓存页面 减轻服务器压力
方法: using System; using System.Collections.Generic; using System.Linq; using System.Web; using Syste ...
- Python 爬虫实例(12)—— python selenium 爬虫
# coding:utf- from common.contest import * def spider(): url = "http://www.salamoyua.com/es/sub ...
- java实现windows下amr转换为mp3(可实现微信语音和qq语音转换)
最近做一个项目需要将微信的语音文件放在页面进行播放,查了好多资料发现,web页面直接播放并没有一个好的解决方案,于是就想到了先将amr文件转换成易于在页面播放的mp3文件,然后在进行播放,现在将amr ...