今天练习写临时存储上传的时候,
一直报错这个,看了错误提示,才发现可能是我没有引入依赖包
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>
两者看看有没有缺依赖包,对你有帮助的话,不妨点个赞!