Spring Boot 报错记录
Spring Boot 报错记录
由于新建的项目没有配置数据库连接启动报错,可以通过取消自动数据源自动配置来解决
解决方案1:
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
//@SpringBootApplication
@MapperScan("com.example.*") //扫描:该包下相应的class,主要是MyBatis的持久化类.
解决方案2:
#去配置文件中配置数据库连接参数
########################################################
###datasource -- mysql\u7684\u6570\u636e\u5e93\u914d\u7f6e.
########################################################
spring.datasource.url = jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8
spring.datasource.username = root
spring.datasource.password = root
spring.datasource.driverClassName = com.mysql.jdbc.Driver
spring.datasource.max-active=20
spring.datasource.max-idle=8
spring.datasource.min-idle=8
spring.datasource.initial-size=10
热启动占用端口报错
解决方案1:
#在配置文件中修改端口号
server.port=8888
解决方案2:
选择另外一种热启动方式,或者关闭端口
扫描包的注解 @MapperScan 和 @ComponentScan 的区别
首先,@ComponentScan是组件扫描注解,用来扫描@Controller @Service @Repository这类,主要就是定义扫描的路径从中找出标志了需要装配的类到Spring容器中
其次,@MapperScan 是扫描mapper类的注解,就不用在每个mapper类上加@MapperScan了
这两个注解是可以同时使用的。@SpringBootApplication
//扫描:该包下相应的class,主要是MyBatis的持久化类.
@MapperScan("com.example.mapper")
//扫描controller、service等
@ComponentScan(basePackages = { "com.example.controller", "com.example.service"})
Spring Boot 报错记录的更多相关文章
- Spring Boot报错 MultipartException The temporary upload...
Spring Boot报错:尤其是在处理Ribbon这类接口调用型的负载均衡组件,常见问题 ERROR o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.se ...
- 初学 Spring boot 报错 Whitelabel Error Page 404
按照教程,写了个最简单的 HelloWorld,尼玛报错 -->Whitelabel Error Page 404. 网上99%都是项目结构不对,说什么 Application放在父级 pack ...
- 启动Spring boot报错:nested exception is java.sql.SQLException: Field 'id' doesn't have a default value
先看具体日志: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with n ...
- spring boot 报错 Failed to read HTTP message
2008-12-13 15:06:03,930 WARN (DefaultHandlerExceptionResolver.java:384)- Failed to read HTTP message ...
- Spring Boot 报错:Error creating bean with name 'entityManagerFactory' defined in class path resource
spring boot 写一个web项目,在使用spring-data-jpa的时候,启动报如下错误: Error starting ApplicationContext. To display th ...
- Spring boot 报错 Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
在实际开发中修改别人的代码,发现了这个报错,后来发现是因为pom.xml里面 只要将注释掉的部分注释掉就好了.
- spring boot 报错 Error creating bean with name
Application 启动类 要和父目录平级
- spring boot 报错
错误1: 循环 的 请求. ..例如 cirle..url 在返回的模板路径上 加速 "/" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 错误2 : 添加了sh ...
- spring boot报错:Invalid bound statement (not found): com.
经检查发现mapper的namespace没写全导致的 正确应该写成这样就可以了:
随机推荐
- outlook使用inline style回复邮件
Reply with inline comments within the original message text When you reply to email messages in Outl ...
- Mongodb 性能测试
测试硬件环境 MacPro 处理器名称: Intel Core i7 处理器速度: 2.5 GHz 处理器数目: 1 核总数: 4 L2 缓存(每个核): 256 KB L3 缓存: 6 MB 内存: ...
- CentOS 7下升级python版本到3.X
由于python官方已宣布2.x系列即将停止支持,为了向前看,我们升级系统的python版本为3.x系列服务器系统为当前最新的CentOS 7.4 1.安装前查看当前系统下的python版本号 # p ...
- jQuery基础教程之is()方法和has() 方法
is()方法 —— 用于筛选 语法: jQueryObject.is( expr )返回值: is()函数的返回值为Boolean类型.true或者false.只要其中至少有一个元素符合给定的表达式就 ...
- Eclipse插件pydev编辑.py文件时报错:unresolved import error.解决办法
在同一个包中import还报unresolved import error.感觉很奇怪,原来需要把当前的包也要添加到System libs中
- intellij中maven不能导入pom文件中指定的jar包
pom文件配置依赖的jar包版本,可以有默认的版本,如下 <profiles> <profile> <id>default_version</id> & ...
- easyUI学习笔记二
1. 拖拉大小 <!DOCTYPE html> <html> <head> <title>easyui学习</title> <scr ...
- Swift——(六)Swift中的值类型
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/twlkyao/article/details/34855597 在Swift中,结构体和枚举 ...
- 虚拟机复制的linux无法联网,解决Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization.
一.问题描述 OS:centos 原因是拷贝虚拟机造成的. 使用vmworkstation打开虚拟机的时候,要选择copy而非move. 二.解决描述 网络上解决步骤各异,其实就一句话.只要保证vmw ...
- shell input value from console
echo "Please enter some input: " read input_variable echo "You entered: $input_variab ...