Spring gradle 构建error

  发布日期:   2017-10-31
  最新修改:   2020-09-19
  阅读次数:   87 次

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' 依赖

   转载规则

《Spring gradle 构建error字》GajAngels 采用 知识共享署名-非商业性使用 4.0 国际许可协议 进行许可。