zoukankan      html  css  js  c++  java
  • 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

    在主类的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 &

    文章来源:NSGUF,欢迎分享,转载请保留出处
  • 相关阅读:
    C项目实践--贪吃蛇(2)
    Dos下同时执行多条命令简化操作
    C语言进入界面编程准备篇
    C项目实践--图书管理系统(4)
    C项目实践--图书管理系统(3)
    C项目实践--图书管理系统(1)
    C项目实践--图书管理系统(2)
    bzoj2302: [HAOI2011]Problem c
    bzoj3545: [ONTAK2010]Peaks
    loj#2537. 「PKUWC2018」Minimax
  • 原文地址:https://www.cnblogs.com/NSGUF/p/9694989.html
Copyright © 2011-2022 走看看