1.在springboot 启动报错

** WARNING ** : Your ApplicationContext is unlikely to start due to a @ComponentScan of the default package.

该警告说明

ApplicationContext 不能从一个组件的默认包启动

解决办法

 创建一个包,将启动文件放到这个包里。

如下:

package app;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication
public class DemoApplication { public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}

把启动文件放到app包下。

2.启动出错

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

出错原因:

程序中引入了mybatis ,但是代码中没有做任何配置。

所以需要在pom.xml 注释代码

<!--
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.2</version>
</dependency>
-->

 3.启动后访问不到控制器方法

原因:

启动程序没有和控制器在同一个目录。

启动程序放到app目录,控制器在 com目录下,这样控制器方法找不到。

解决办法

将启动程序放到com目录下,启动后问题解决。

springboot 碰到的问题的更多相关文章

  1. SpringBoot碰到的疑问或问题

    1.@ResponseBody 和 @RequestBody 的区别 @ResponseBody是作用在方法上的,@ResponseBody 表示该方法的返回结果直接写入 HTTP response ...

  2. 解决spring-boot启动中碰到的问题:Cannot determine embedded database driver class for database type NONE

    问题 如下: 2017-07-16 08:50:57.436  INFO 13524 --- [           main] c.p.p.web.PointshopWebApplication   ...

  3. 建立第一个SpringBoot小列子(碰到的错误)

    当加入@SpringBootApplication注解时,无法得到解析 错误提示:SpringBootApplication cannot be resolved to a type 错误原因是因为s ...

  4. 解决spring-boot启动中碰到的问题:Cannot determine embedded database driver class for database type NONE(转)

    问题 如下: 2017-07-16 08:50:57.436  INFO 13524 --- [           main] c.p.p.web.PointshopWebApplication   ...

  5. 使用spring-boot 国际化配置所碰到的乱码问题

    写好html静态页面 ,  也加上了编码格式 , 获取国际化展示在浏览器中还是存在乱码 , 开始以为是浏览器编码格式问题 , 做过处理后任没有得到解决 , 具体的处理方案如下: <meta ht ...

  6. SpringBoot整合mybatis碰到的问题

    整合mybatis 1.  导包:在原有的web项目的基础上加上 <!--JDBC连接-->     <dependency>         <groupId>m ...

  7. springboot 使用c3p0数据库连接池的方法

    使用springboot开发时,默认使用内置的tomcat数据库连接池,经常碰到这种情况:运行时间一长,数据库连接中断了.所以使用c3p0连接池吧. 引入的maven依赖: <dependenc ...

  8. springboot 开发入门,及问题汇总

    1 . springboot简单介绍(http://projects.spring.io/spring-boot/) 现在的web项目几乎都会用到spring框架,而要使用spring难免需要配置大量 ...

  9. Jenkins远程部署SpringBoot应用

    一般Web工程通过Jenkins远程部署到Tomcat,可以采用Maven的tomcat-maven-plugin插件进行部署.最近接触到Spring Boot工程的部署,由于Spring Boot应 ...

随机推荐

  1. 截图原理(一)——Android自动化测试学习历程

    把两节的内容汇总起来,第一节讲的是如何在apk中直接进行截屏,用到了Robotium的Solo类的takeScreenShot方法,有一个小的demo,以及从方法一直往里钻,知道它具体是怎么进行截屏的 ...

  2. asp相关知识整理

    WWW----World Wide Web(万维网) URL----Uniform Resource Locator(统一资源定位符) HTTP----Hyper Text Transfer Prot ...

  3. Runnable如何传参

    private class TimerUpdateTask implements Runnable{ private boolean isUnion = false; public TimerUpda ...

  4. ubuntu 安装Pangolin 过程

    Pangolin 是一款开源的OPENGL显示库,可以用来视频显示.而且开发容易. 代码我们可以从Github 进行下载:https://github.com/zzx2GH/Pangolin.git ...

  5. [z]重建索引

    https://blog.csdn.net/funnyfu0101/article/details/52961485 所有执行的结果是脚本命令集合,可以用来创建索引: a)在plsql中使用execu ...

  6. jsp获取ip使用request.getRemoteAddr返回0:0:0:0:0:0:0:1

    JAVA Web开发过程中,很多场景下需要获取访问终端的IP,对应方法getRemoteAddr.例如调试过程中本地回环ip地址是127.0.0.1,忽然有一天返回 0:0:0:0:0:0:0:1,这 ...

  7. mysql 存储过程 与 循环

    mysql 操作同样有循环语句操作,三种标准循环模式:while, loop,repeat, 外加一种非标准循环:goto [在c或c#中貌似出现过类型循环但是一般不建议用!] 一般格式为:delim ...

  8. FastDFS集群安装

    集群安装1.FastDFS安装 Tracker,nginx 192.168.56.113       192.168.56.114 storage group1      192.168.56.115 ...

  9. 28335XINTF的简单使用

    28335 XINTF基本特点 一共有三个外部存储区域:区域0(Zone 0),区域6(Zone 6)和区域7(Zone 7).对应的 访问地址为:Zone 0:0x0000_4000-0x0000_ ...

  10. javascript 高级程序设计 八

    function 类型: 1.ECMAscript中函数和类C语言的函数有这很多不同.其中之一就是js的函数没有重载.并且多次定义一个同名的函数,当调用这个函数的时候, 会调用最后一次定义的函数. 2 ...