Stopping service [Tomcat]
1.缺少 Serivce注解无法启动tomcat
2.包名错误
3.写了注解没写参数
使用Eclipse调试Spring boot项目时总是直接进入SilentExitExceptionHandler
解决方案:Window-->Preference-->java-->debug-->Suspend execution on uncaught exceptions选项前面的勾去掉
springBoot 保存中文乱码 插入数据 ??
解决方案:spring.datasource.url=jdbc:mysql://localhost:3306/springboot?useUnicode=true&characterEncoding=utf8
springBoot上传文件 获取文件 file 为null
MultipartHttpServletRequest mh=(MultipartHttpServletRequest) request;
CommonsMultipartFile cmf=(CommonsMultipartFile) mh.getFile("file");
解决方法:
MultipartResolver resolver = new CommonsMultipartResolver(request.getSession().getServletContext());
MultipartHttpServletRequest multipartRequest = resolver.resolveMultipart(request);
CommonsMultipartFile cmf = (CommonsMultipartFile) multipartRequest.getFile("file");
freemarker thymeleaf 访问页面不显示缓存
@RestController 替换为 @Controller
log4j jar包冲突
解决方法:注掉log包添加pom
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
mybatis 异常 Exception in thread "restartedMain" java.lang.reflect.InvocationTargetException