springboot 碰到的问题
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 碰到的问题的更多相关文章
- SpringBoot碰到的疑问或问题
1.@ResponseBody 和 @RequestBody 的区别 @ResponseBody是作用在方法上的,@ResponseBody 表示该方法的返回结果直接写入 HTTP response ...
- 解决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 ...
- 建立第一个SpringBoot小列子(碰到的错误)
当加入@SpringBootApplication注解时,无法得到解析 错误提示:SpringBootApplication cannot be resolved to a type 错误原因是因为s ...
- 解决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 ...
- 使用spring-boot 国际化配置所碰到的乱码问题
写好html静态页面 , 也加上了编码格式 , 获取国际化展示在浏览器中还是存在乱码 , 开始以为是浏览器编码格式问题 , 做过处理后任没有得到解决 , 具体的处理方案如下: <meta ht ...
- SpringBoot整合mybatis碰到的问题
整合mybatis 1. 导包:在原有的web项目的基础上加上 <!--JDBC连接--> <dependency> <groupId>m ...
- springboot 使用c3p0数据库连接池的方法
使用springboot开发时,默认使用内置的tomcat数据库连接池,经常碰到这种情况:运行时间一长,数据库连接中断了.所以使用c3p0连接池吧. 引入的maven依赖: <dependenc ...
- springboot 开发入门,及问题汇总
1 . springboot简单介绍(http://projects.spring.io/spring-boot/) 现在的web项目几乎都会用到spring框架,而要使用spring难免需要配置大量 ...
- Jenkins远程部署SpringBoot应用
一般Web工程通过Jenkins远程部署到Tomcat,可以采用Maven的tomcat-maven-plugin插件进行部署.最近接触到Spring Boot工程的部署,由于Spring Boot应 ...
随机推荐
- 两种方法修改pyhton爬虫的报头
方法一: import urlib.request url = "" headers=("User-Agent","") opener = ...
- 游戏引擎架构,3d游戏引擎设计、Unreal引擎技术等五本PDF推荐
扫码时备注或说明中留下邮箱 付款后如未回复请至https://shop135452397.taobao.com/ 联系店主
- POJ 1177 Picture(线段树周长并)
描述 A number of rectangular posters, photographs and other pictures of the same shape are pasted on ...
- Mac下IntelliJ的Git、GitHub配置及使用
1.git简介 Git是目前流行的分布式版本管理系统.它拥有两套版本库,本地库和远程库,在不进行合并和删除之类的操作时这两套版本库互不影响.也因此其近乎所有的操作都是本地执行,所以在断网的情况下任然可 ...
- hangfire enqueued but not processing(hangfire 定时任务入队列但不执行)
不生效的方法 //RecurringJob.AddOrUpdate<FamilyAppService>((s) => s.UpdateFamilyLevel(), input.Cro ...
- Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools"
https://blog.csdn.net/saucyj/article/details/79043443
- opencv 双边模糊,膨胀腐蚀 开 闭操作
#include <opencv2/opencv.hpp> #include <iostream> using namespace cv; int main(int argc, ...
- VS2010下MFC的串口编程
串口通信简介 一般来说,计算机都有一个或多个串行端口,这些串口提供了外部设备与PC进行数据传输和通信的通道,在CPU和外设之间充当解释器的角色.当字符数据从CPU发送给外设时,这些字符数据将被转换成串 ...
- Centos Raid0 与Raid1 的备注
http://www.360doc.com/content/13/1209/21/14661619_335823338.shtml raid0 如果坏了一块硬盘.那么数据就无法读取了 raid1 如果 ...
- Python之路(第十六篇)xml模块、datetime模块
一.xml模块 xml是实现不同语言或程序之间进行数据交换的协议,跟json差不多,但json使用起来更简单, xml比较早,早期许多软件都是用xml,至今很多传统公司如金融行业的很多系统的接口还主要 ...