Spring-Cloud编译出错汇总
2017-12-15 23:45
351 查看
问题1:
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException:
No unique bean of type [com.mkyong.common.Person] is defined:
expected single matching bean but found 2: [personA, personB]
解决办法: @Qualifier()配合@Service()使用。
如:
在service实现类中:
@Service("ons")
public class VideointercomappService implements IVideointercomappService{}
在controller中引用:
@Autowired
@Qualifier("ons")
IVideointercomClients iVideointercomClients;
问题2:
The field file exceeds its maximum permitted size of 1048576 bytes.] with root cause
解决:
SpringBoot做文件上传时出现了The field file exceeds its maximum permitted size of 1048576 bytes.错误,显示文件的大小超出了允许的范围,原来Spring Boot工程嵌入的tomcat限制了请求的文件大小,这一点在Spring Boot的官方文档中有说明。
在application.yml
spring:
http:
multipart:
max-file-size: 20Mb
max-request-size: 20Mb
问题3:
端口被暂用,无法启动工程
解决:
1、命令行模式查找到占用端口的进程号PID是多少,如:8080
netstat -ano | findstr 8080
这个命令输出的最后一列表示占用8080端口的进程号是多少,假设为1234
2、kill掉这个进程即可
taskkill /F /PID 1234
问题4.
当需要看js中返回json对象内容时:
JSON.parse(jsonstr); //可以将json字符串转换成json对象
JSON.stringify(jsonobj); //可以将json对象转换成json对符串
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException:
No unique bean of type [com.mkyong.common.Person] is defined:
expected single matching bean but found 2: [personA, personB]
解决办法: @Qualifier()配合@Service()使用。
如:
在service实现类中:
@Service("ons")
public class VideointercomappService implements IVideointercomappService{}
在controller中引用:
@Autowired
@Qualifier("ons")
IVideointercomClients iVideointercomClients;
问题2:
The field file exceeds its maximum permitted size of 1048576 bytes.] with root cause
解决:
SpringBoot做文件上传时出现了The field file exceeds its maximum permitted size of 1048576 bytes.错误,显示文件的大小超出了允许的范围,原来Spring Boot工程嵌入的tomcat限制了请求的文件大小,这一点在Spring Boot的官方文档中有说明。
在application.yml
spring:
http:
multipart:
max-file-size: 20Mb
max-request-size: 20Mb
问题3:
端口被暂用,无法启动工程
解决:
1、命令行模式查找到占用端口的进程号PID是多少,如:8080
netstat -ano | findstr 8080
这个命令输出的最后一列表示占用8080端口的进程号是多少,假设为1234
2、kill掉这个进程即可
taskkill /F /PID 1234
问题4.
当需要看js中返回json对象内容时:
JSON.parse(jsonstr); //可以将json字符串转换成json对象
JSON.stringify(jsonobj); //可以将json对象转换成json对符串
相关文章推荐
- Spring干货汇总(含Spring Boot与Spring Cloud)
- Spring干货汇总(含Spring Boot与Spring Cloud)
- xcode编译出错问题汇总
- Spring干货汇总(含Spring Boot与Spring Cloud)
- Spring使用@Aspect注解编译出错
- java编译出错信息汇总(更新)
- Spring干货汇总(含Spring Boot与Spring Cloud)
- VS编译出错问题汇总
- spring cloud相关知识汇总
- Spring干货汇总(含Spring Boot与Spring Cloud)
- Spring Cloud搭建微服务架构----文章汇总
- IMX6平台:Linux编译Kernel、Uboot等出错问题汇总
- spring boot项目构建出错,编译失败提示少包解决办法
- SpringCloud问题解决:spring-cloud-eureka启动出错Cannot execute request on any known server
- linux下《UNIX环境高级编程》(apue2)源码编译出错的处理方法汇总
- Spring Cloud Zuul中使用Swagger汇总API接口文档
- Android 源码编译出错汇总
- SpringCloud的注解:汇总篇
- Spring干货汇总(含Spring Boot与Spring Cloud)
- springcloud学习资料汇总