目录

Spring gradle 构建error

目录

Caused by: java.lang.IllegalStateException: Failed to introspect Class [org.springframework.web.multipart.commons.CommonsMultipartResolver] from ClassLoader [WebappClassLoader context: blog delegate: false ———-> Parent Classloader: java.net.URLClassLoader@619a5dff ] at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:659) at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:556) at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:541) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:245) … 66 more Caused by: java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lang.Class.getDeclaredMethods(Class.java:1975) at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:641) … 69 more Caused by: java.lang.ClassNotFoundException: org.apache.commons.fileupload.FileItemFactory at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1308) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1142) … 73 more- 一般这种问题很好解决,添加缺少的jar包即可

  • 由于我是使用gradle构建项目,所以直接加上compile group: ‘commons-fileupload’, name: ‘commons-fileupload’, version: ‘1.3.3’ 依赖