一、Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.

    既然他说该类不能从组件的默认包启动,那就给他建立一个包好了。

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

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

 

二、cannot start process,the working directory 'E:\springboot\springboot' does not exist.

 

 

三、Cannot determine embedded database driver class for database type NONE。

   是因为引入的springboot项目中pom.xml中引入的依赖多了,可以去掉一步步测试,或者添加application.properties 文件

    spring.datasource.url=jdbc:mysql://localhost:3306/test
    spring.datasource.username=root
    spring.datasource.password=root
    spring.datasource.driver-class-name=com.mysql.jdbc.Driver
    spring.datasource.max-idle=10
    spring.datasource.max-wait=10000
    spring.datasource.min-idle=5
    spring.datasource.initial-size=5

 四、修改springboot启动图像

    (1).在src/main/resources路径下新建一个banner.txt文件,并输入想要的内容即可。

    (2).用在线生成图案的网站 http://patorjk.com/software/taag/

    (3).想要关闭Banner内容,只需要修改Main函数即可,我这里提供一种方法。

      @SpringBootApplication
      @RestController
      public class Application {
      @RequestMapping("/")
      public String greeting() {
        return "Hello World!";
      }

      public static void main(String[] args) {
        //SpringApplication.run(Application.class, args);
        SpringApplication newRun= new SpringApplication(Application.class);
        newRun.setBannerMode(Banner.Mode.OFF);
        newRun.run(args);
      }
    }

    (4).样式的修改,参照https://www.cnblogs.com/cc11001100/p/7456145.html

五、mybatis+spring boot, mapper 提示Could not autowire. No beans of … type found问题

  (1).可以将File-Project Structure 页面 Facets下删掉 Spring(直接右键Delete)。并不会降低安全性!!因为创建项目的时候,都是先创建空项目再创建web moduele(你想直接创建web project也可以),一般不会使用spring组件。都是自己配置的。这时候你要是不小心手滑(手滑原因:因为idea对你spring的配置文件会在上方报警告,然后你一fix,就容易出事),那就会报错无法Autowired。所以你只要删掉你手滑添加的就可以

  (2).在IDEA中安装了【MyBatis Plugin】插件,但是仍然有红色报错提示。猜测可能是装插件的方法只对xml配置的情况有效,@Mapper注解interface时仍然不行。于是只好在Dao interface上加上了@Repository注解,也算是解决了,没有很大的副作用。

    spring boot+mybatis+idea,sql语句使用注解方式,没有XXmapper.xml文件。

  (3).修改idea配置,将spring 的severity的值设置为"warning",如下图:

   (4).使用  @Autowired(required = false),这个跟方法3是相同效果。@Autowired(required = false)在找不到匹配 Bean 时也不报错。和降低警告级别是同一个意思吧