报错信息:
2024-07-01 14:08:04.605 http-nio-8035-exec-10 ERROR org.apache.juli.logging.DirectJDKLog 182 log - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.io.IOException: The temporary upload location [/tmp/tomcat/work/Tomcat/localhost/ROOT] is not valid] with root cause java.io.IOException: The temporary upload location [/tmp/tomcat/work/Tomcat/localhost/ROOT] is not valid
场景:
业务线下拉框选择后去查询产品线的时候报错
原因:
因为前端这俩传参方式选择错了 图2
测试:
在postman中试了用x-www-form-urlencoded传的时候是可以成功请求的,但是form-data方式传报错 图1
报错系统:
修改:
代码本来是这样的
加了一个@RequestParam("bizId")注解就好了
总结:查问题的时候都是说文件上传的问题,但是其实此接口很简单没有涉及到文件上传