AI智能
改变未来

临时文件存储上传报错Error creating bean with name ******: Failed to introspect bean class

今天练习写临时存储上传的时候,
一直报错这个,看了错误提示,才发现可能是我没有引入依赖包

Error creating bean with name \'multipartResolver\':Failed to introspect bean class [org.springframework.web.multipart.commons.CommonsMultipartResolver] for lookup method metadata:could not find class that it depends on; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory

解决方法:
加入依赖包

<dependency><groupId>commons-fileupload</groupId><artifactId>commons-fileupload</artifactId><version>1.3.1</version></dependency><dependency><groupId>commons-io</groupId><artifactId>commons-io</artifactId><version>2.4</version></dependency>

两者看看有没有缺依赖包,对你有帮助的话,不妨点个赞!

赞(0) 打赏
未经允许不得转载:爱站程序员基地 » 临时文件存储上传报错Error creating bean with name ******: Failed to introspect bean class