• Spring上传文件报错


    org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.web.multipart.MultipartFile]: Specified class is an interface
        org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:101)
        org.springframework.web.bind.annotation.support.HandlerMethodInvoker.resolveModelAttribute(HandlerMethodInvoker.java:762)
        org.springframework.web.bind.annotation.support.HandlerMethodInvoker.resolveHandlerArguments(HandlerMethodInvoker.java:356)
        org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:171)
        org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:426)
        org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:414)
        org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
        org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
        org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
        org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
        org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
        org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

    解决方案:在Controller的MultipartFile参数前面加上@RequestParam就解决了!

  • 相关阅读:
    Linux内核tracepoints
    Linux 设备驱动的固件加载
    Android HIDL HAL 接口定义语言详解
    Android HIDL 详解
    Android各版本对应的SDK版本
    ifconfig调用过程
    Input系统—启动篇
    Linux下2号进程的kthreadd--Linux进程的管理与调度
    rest_init函数分析(续)
    【python】-常用模块2
  • 原文地址:https://www.cnblogs.com/KMException/p/7383120.html
Copyright © 2020-2023  润新知