spring boot踩坑记

  • Resolved exception caused by handler execution: org.springframework.http.converter.HttpMessageNotWritableException: No converter found for return value of type: class cn.argonavis.labeltool.bean.ResponseBean

    将return的类添加getter/setter;

  • 前端报错:POST http://127.0.0.1:8080/upload/img net::ERR_CONNECTION_RESET 且后端报错:2018-09-21 10:57:29.469 WARN 7076 --- [nio-8080-exec-4] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved exception caused by handler execution: org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'userId' is not present
    2018-09-21 10:57:30.442 WARN 7076 --- [nio-8080-exec-5] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved exception caused by handler execution: org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'userId' is not present
    2018-09-21 10:57:31.446 WARN 7076 --- [io-8080-exec-14] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved exception caused by handler execution: org.springframework.web.bind.MissingServletRequestParameterException: Required String parameter 'userId' is not present

    这个的意思应该是数据量太大,spring boot自动拦截了,所以会不停的发好几次,导致后端报好几个这个问题;解决方法:
    配置文件里添加:server.tomcat.max-http-post-size=50000000

  • log4j:WARN No appenders could be found for logger (cn.argonavis.labeltool.util.HttpRequestUtils).
    log4j:WARN Please initialize the log4j system properly.
    log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

    在主类的main函数中添加 BasicConfigurator.configure();即可;

  • java.io.IOException: Stream closed

    fw.close();
    bw.close();
    改成

    bw.close();
    fw.close();
    运行war:nohup java -jar spring-boot-1.0-SNAPSHOT.jar > log.file 2>&1 &

转载于:https://www.cnblogs.com/NSGUF/p/9694989.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值