ClassNotFoundException:org.apache.http.util.Args-如何使用MultipartEntityBuilder上传Fille?

时间:2018-09-03 11:25:12

标签: dependencies httpclient

这就是我要得到的

  

org.apache.http.util.Args。 Stacktrace如下:消息:   org.apache.http.util.Args       线|方法   ->> 366 |在java.net.URLClassLoader $ 1中运行   ------------------------------------ 355 |在...中运行354 | findClass。 。 。 。 。 。 。 。 。 。 。 。在java.net.URLClassLoader中| 423   | java.lang.ClassLoader中的loadClass | 48   | 。 。 。 。 。 。 。 。 。 。 。 。 。 。在   org.apache.http.entity.mime.content.AbstractContentBod | 155 |                                在   org.apache.http.entity.mime.content.StringBody | 121 | addTextBody   。 。 。 。 。 。 。 。 。 。 。在   org.apache.http.entity.mime.MultipartEntityBuilder | 271 |   $ tt__getResponseFromHttpPostServer在   com.org.basepin.UserService $$ ER2a9kvc | 184 | $ tt__createRequest。   。 。 。 。 。 。 。在“ | 437 | $ tt__uploadClashImages
  在“ | 1325 | doCall。 。 。 。 。 。 。 。 。 。 。 。 。 。在   com.org.basepin.UserController $ _fetchClashReportImages | 1323 |   com.org.basepin.UserController中的fetchClashReportImages |   198 | doFilter。 。 。 。 。 。 。 。 。 。 。 。 。在   grails.plugin.cache.web.filter.PageFragmentCachingFilt | 63 |   doFilter在   grails.plugin.cache.web.filter.AbstractFilter | 1110 | runWorker。 。   。 。 。 。 。 。 。 。 。 。在java.util.concurrent.ThreadPoolExecutor中|
  603 |跑进   java.util.concurrent.ThreadPoolExecutor $ Worker ^ 722 |跑 。 。 。 。   。 。 。 。 。 。 。 。 。 。 。在java.lang.Thread

BuildConfig.groovy dependencies{

 compile('org.apache.httpcomponents:httpcore:4.2.4'){
             excludes "commons-codec"
         }
         compile('org.apache.httpcomponents:httpclient:4.1.2'){
             excludes "commons-codec"
         }
         compile('org.apache.httpcomponents:httpmime:4.3'){
             excludes "commons-codec"
         }
         //compile "org.grails.plugins:rest:0.8"

        runtime('org.apache.httpcomponents:httpcore:4.2.4'){
            excludes "commons-codec"
        }
        runtime('org.apache.httpcomponents:httpclient:4.1.2'){
            excludes "commons-codec"
        }
        runtime('org.apache.httpcomponents:httpmime:4.3'){
            excludes "commons-codec"
        }
     }

任何帮助将不胜感激

1 个答案:

答案 0 :(得分:0)

快速浏览一下,我假设httpmime 4.3使用了Args类,并且期望它由httpcore依赖项提供。您并不依赖于httpcore的4.3版本,那似乎是在引入它时。

将您的httpcore依赖项更新为4.3,此错误应该可以解决。当您使用它时,我会让所有这三个依赖项使用相同的版本,否则您可能会看到这些错误中的另一个错误。

相关问题