项目场景:

HTTP Status 500 - Request processing failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.multipart.MultipartFile]: Specified class is an interface
Failed to instantiate [org.springframework.web.multipart.MultipartFile]: Specified class is an inter

问题描述:

HTTP Status 500 - Request processing failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.multipart.MultipartFile]: Specified class is an interface

原因分析:

@RequestParam MultipartFile获取上传文件名称

controller层通过name值提取文件image的信息。
Spring MultipartFile 参数必须要带着@RequestParam, Spring上传文件时MultipartFile 类型的参数上边一定要写@RequestParam注解 ,不然编译部署到服务器上之后,可能会报错误。为什么是可能 ,学习的时候自己用的idea ,老师讲的时候用的eclipse,还有几个同学也用的idea,他们都没加这个注解 ,但他们都没报错。人品也有原因。

解决方案:

Failed to instantiate [org.springframework.web.multipart.MultipartFile]: Specified class is an inter

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2022-01-11
  • 2021-08-07
  • 2021-09-08
猜你喜欢
  • 2022-01-19
  • 2022-01-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案