SpringBoot出现下列错误。

Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package
Destroy method on bean with name 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory' threw an exception

或者

Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package
Destroy method on bean with name 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory' threw an exception

或者
ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@4b9e255: startup date [Wed Jul 26 13:37:27 CST 2017]; root of context hierarchy

主要是由于application.java文件没有放在main/java文件夹的原因,因为application.Java 文件不能直接放在main/java文件夹下,必须要建一个包把他放进去
SpringBoot在写启动类的时候如果不使用@ComponentScan指明对象扫描范围,默认指扫描当前启动类所在的包里的对象,如果当前启动类没有包,则在启动时会报错:
Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package错误。

@SpringBootApplication
@ComponentScan(basePackageClasses=MytestApplication.class)
public class MytestApplication {

public static void main(String[] args){
SpringApplication.run(MytestApplication.class, args);
}
}

@ComponentScan(basePackageClasses=要扫描类.class所在位置的包)-意思是要扫描哪个类所在的包
---------------------
作者:King-Long
来源:CSDN
原文:https://blog.csdn.net/u011095110/article/details/76144416

springboot 项目 注意事项的更多相关文章

  1. springboot项目属性配置及注意事项

    在idea编辑器建的springboot项目中的resources包下的application.properties这个就是配置文件. 另外配置文件的文件名还可以是application.yml,在r ...

  2. 小D课堂-SpringBoot 2.x微信支付在线教育网站项目实战_2-1.快速搭建SpringBoot项目,采用Eclipse

    笔记 1.快速搭建SpringBoot项目,采用Eclipse     简介:使用SpringBoot start在线生成项目基本框架并导入到eclipse中 1.站点地址:http://start. ...

  3. springboot项目部署到服务器上

    链接:https://blog.csdn.net/qq_22638399/article/details/81506448#commentsedit 链接2:https://blog.csdn.net ...

  4. SpringBoot 项目部署(初级)

    之前的项目一直在本地电脑上写,最近需要将项目部署到服务器上进行联调测速度.于是,在网上搜集资料后简单的进行一下总结. 由于本次打包部署是为了测试,于是很多内容做的还不算详尽,只是将项目简单的打包为ja ...

  5. 使用外部容器运行spring-boot项目:不使用spring-boot内置容器让spring-boot项目运行在外部tomcat容器中

    前言:本项目基于maven构建 spring-boot项目可以快速构建web应用,其内置的tomcat容器也十分方便我们的测试运行: spring-boot项目需要部署在外部容器中的时候,spring ...

  6. SpringBoot01 InteliJ IDEA安装、Maven配置、创建SpringBoot项目、属性配置、多环境配置

    1 InteliJ IDEA 安装 下载地址:点击前往 注意:需要下载专业版本的,注册码在网上随便搜一个就行啦 2 MAVEN工具的安装 2.1 获取安装包 下载地址:点击前往 2.2 安装过程 到官 ...

  7. idea快速搭建springboot项目

    Spring Boot是由Pivotal团队提供的全新框架,设计目的是用来简化新Spring应用的初始搭建以及开发过程.它主要推崇的是'消灭配置',实现零配置. 那么,如何在idea中创建一个spri ...

  8. IDEA快速创建Maven+SpringBoot项目时:Cannot download https://start.spring.io;Status:403

    先展示一下我遇到的问题: 用浏览器搜索是有页面的,但是但是但是呢,用IDEA快速构建的时候就报403 咳咳!巴格虐我万千遍,我待技术如初恋... 我看到的解决办法有以下两种,当然,我只想说:" ...

  9. springboot:快速构建一个springboot项目

    前言: springboot作为springcloud的基础,springboot的热度一直很高,所以就有了这个springboot系列,花些时间来了解和学习为自己做技术储备,以备不时之需[手动滑稽] ...

随机推荐

  1. HBase配置性能调优

    因官方Book Performance Tuning部分章节没有按配置项进行索引,不能达到快速查阅的效果.所以我以配置项驱动,重新整理了原文,并补充一些自己的理解,如有错误,欢迎指正. 配置优化 zo ...

  2. C# 将本地文件远程拷贝到其他电脑(转)

    string newpath = System.IO.Path.GetFullPath(@"////10.144.26.252//d$//quyuan//图片" +"// ...

  3. for练习.html

    <script> 偶数 var str=""; for (var i = 1 ; i <= 100; i++){ if (i%2 == 0) { //str = ...

  4. WPF开发ArcGis系统时的异常信息: ArcGIS product not specified. You must first bind to an ArcGIS version prior to using any ArcGIS components.

    “System.Runtime.InteropServices.COMException”类型的未经处理的异常在 Arcgis_Test.exe 中发生 其他信息: ArcGIS product no ...

  5. 硬盘读取不了-->>完美解决

    说明:电脑装了两个硬盘,一个固态一个机械,装完系统之后读取不到机械硬盘的数据,网上很多人都说格式化之后分盘,但是!!!里面的数据咋办?千万别自己倒腾转换格式什么的,一不小心数据真的丢了,那就再也找不回 ...

  6. getpass模块 ---- optparse

    getpass模块,不回显 常用方法 import getpass password=getpass.getpass('input your password: ').strip() 其他用法 use ...

  7. Application failed to start because it could not find or load the QT platform plugin “windows”

    只需要在.exe所在的目录下创建一个目录platforms添加进去缺失的dll即可如图: 参考链接:https://stackoverflow.com/questions/21268558/appli ...

  8. ansible安装使用入门

    生成对称密钥 执行以下命令,会在当前用户的.ssh目录下生成id_rsa和id_rsa_pub两个文件. ssh-keygen -t rsa root用户:/root/.ssh 普通用户:/home/ ...

  9. ORA-01940:无法删除当前已链接的用户(转)

    (1)查看用户的连接状况 select username,sid,serial# from v$session ------------------------------------------ 如 ...

  10. Faster RCNN原理分析(二):Region Proposal Networks详解

    Faster RCNN原理分析(二):Region Proposal Networks详解 http://lib.csdn.net/article/deeplearning/61641 0814: A ...