java.lang.NoSuchFieldError: DEF_CONTENT_CHARSET

こ雲淡風輕ζ 提交于 2019-11-27 09:41:35

You've got two different versions of httpcore in your classpath:

~/.m2/repository/org/apache/httpcomponents/httpcore/4.0.1/httpcore-4.0.1.jar
~/ms_thesis/ONOS/httpcore-4.1.jar

... although the second one is actually exported as CLASSPAHT according to your question. We also don't know what's in your lib directory - there could be even more versions around.

There would also be two versions of httpclient, except one is commented out. I suggest you sort all of this out so that you're only using the latest versions of both libraries. My guess is that what's actually being picked up is one version of httpclient and one version of httpcore, and they're not compatible. Either that, or just within httpcore there's some manifest entry being picked up from one jar file, but then when a class is asked for it's getting the other.

Either way, having two versions of the same library in your classpath at a time is simply a bad idea.

You should also make sure that the version of httpcore that you use is appropriate for the version of httpclient you use. For example, I've just downloaded the latest version of httpclient (4.2.5) and it uses httpcore 4.2.4. If you're trying to use httpclient-4.2 with httpcore-4.1, that may not be compatible.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!