Dependencies ClassNotFoundException:org.apache.http.util.Args-如何使用MultipartEntityBuilder上载文件?
这就是我得到的 org.apache.http.util.Args。Stacktrace如下:消息: org.apache.http.util.Args 直线法 ->>366 |在java.net.URLClassLoader$1中运行 -————————————————————————————————————————————————————————————————————————————。在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\uu getResponseFromHttpPostServer位于 com.org.basepin.UserService$$ER2a9kvc | 184 |$tt|U createRequest。 . . . . . . . 在| 437 |$tt|U上传分类中 在| 1325 |文件中。在里面 com.org.basepin.UserController$_fetchclasherportimages | 1323| 在com.org.basepin.UserController中获取clashreportimages| 198 | doFilter。在里面 grails.plugin.cache.web.filter.PageFragmentCachingFilt | 63| 多芬 grails.plugin.cache.web.filter.AbstractFilter | 1110 | runWorker。 . . . . . . . . . . 在java.util.concurrent.ThreadPoolExecutor中| 603 |磨合 java.util.concurrent.ThreadPoolExecutor$Worker^722 |运行。 . . . . . . . . . . . 在java.lang.Thread中Dependencies ClassNotFoundException:org.apache.http.util.Args-如何使用MultipartEntityBuilder上载文件?,dependencies,httpclient,Dependencies,Httpclient,这就是我得到的 org.apache.http.util.Args。Stacktrace如下:消息: org.apache.http.util.Args 直线法 ->>366 |在java.net.URLClassLoader$1中运行 -————————————————————————————————————————————————————————————————————————————。在java.net.URLClassLoader | 423中 |java.lang.ClassLoade
快速浏览一下,我会假设HttpTime 4.3使用了该Args类,并且它希望由httpcore依赖项提供。您并不依赖于httpcore的4.3版,而在它推出时似乎就是这样
将您的httpcore依赖项更新为4.3,此错误将得到解决。在您进行此操作时,我会让这三个依赖项使用相同的版本,否则您可能会看到这些错误中的另一个出现。非常感谢您,我只将httpcore依赖项更新为4.3.2,它可以工作:
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"
}
}