def\u content\u charset错误

mzsu5hc0  于 2021-06-24  发布在  Storm
关注(0)|答案(1)|浏览(299)

在我的Storm中,我犯了错误。我经常得到下面的问题请帮助这里。

java.lang.NoSuchFieldError: DEF_CONTENT_CHARSET
    at org.apache.http.impl.client.DefaultHttpClient.setDefaultHttpParams(DefaultHttpClient.java:175) ~[stormjar.jar:?]
    at org.apache.http.impl.client.DefaultHttpClient.createHttpParams(DefaultHttpClient.java:158) ~[stormjar.jar:?]
    at org.apache.http.impl.client.AbstractHttpClient.getParams(AbstractHttpClient.java:448) ~[stormjar.jar:?]
    at org.apache.http.impl.client.AbstractHttpClient.createClientConnectionManager(AbstractHttpClient.java:309) ~[stormjar.jar:?]
    at org.apache.http.impl.client.AbstractHttpClient.getConnectionManager(AbstractHttpClient.java:466) ~[stormjar.jar:?]
    at org.apache.http.impl.client.AbstractHttpClient.createHttpContext(AbstractHttpClient.java:286) ~[stormjar.jar:?]
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:851) ~[stormjar.jar:?]
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805) ~[stormjar.jar:?]
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784) ~[stormjar.jar:?]
    at com.trinity.sensors.LocationName.getPlaceName(LocationName.java:77) ~[stormjar.jar:?]
    at com.trinity.sensors.ItmsVehicleDataBolt.execute(ItmsVehicleDataBolt.java:126) ~[stormjar.jar:?]
    at backtype.storm.topology.BasicBoltExecutor.execute(BasicBoltExecutor.java:50) ~[storm-core-0.10.0.2.4.3.0-227.jar:0.10.0.2.4.3.0-227]
    at backtype.storm.daemon.executor$fn__6713$tuple_action_fn__6715.invoke(executor.clj:684) ~[storm-core-0.10.0.2.4.3.0-227.jar:0.10.0.2.4.3.0-227]
    at backtype.storm.daemon.executor$mk_task_receiver$fn__6636.invoke(executor.clj:431) ~[storm-core-0.10.0.2.4.3.0-227.jar:0.10.0.2.4.3.0-227]
    at backtype.storm.disruptor$clojure_handler$reify__1319.onEvent(disruptor.clj:58) ~[storm-core-0.10.0.2.4.3.0-227.jar:0.10.0.2.4.3.0-227]
    at backtype.storm.utils.DisruptorQueue.consumeBatchToCursor(DisruptorQueue.java:120) ~[storm-core-0.10.0.2.4.3.0-227.jar:0.10.0.2.4.3.0-227]
    at backtype.storm.utils.DisruptorQueue.consumeBatchWhenAvailable(DisruptorQueue.java:99) ~[storm-core-0.10.0.2.4.3.0-227.jar:0.10.0.2.4.3.0-227]
    at backtype.storm.disruptor$consume_batch_when_available.invoke(disruptor.clj:80) ~[storm-core-0.10.0.2.4.3.0-227.jar:0.10.0.2.4.3.0-227]
    at backtype.storm.daemon.executor$fn__6713$fn__6726$fn__6777.invoke(executor.clj:813) ~[storm-core-0.10.0.2.4.3.0-227.jar:0.10.0.2.4.3.0-227]
    at backtype.storm.util$async_loop$fn__544.invoke(util.clj:479) [storm-core-0.10.0.2.4.3.0-227.jar:0.10.0.2.4.3.0-227]
    at clojure.lang.AFn.run(AFn.java:22) [clojure-1.6.0.jar:?]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_77]
2018-05-29 09:21:27.164 b.s.d.executor [ERROR]
jc3wubiy

jc3wubiy1#

请参阅java.lang.nosuchfielderror:def\u content\u charset。您的一些依赖项(可能是apachehttpclient依赖项)是错误的版本。
试着跑步 mvn dependency:tree 在拓扑项目的根目录中。您可能会发现某些版本的httpclient库的版本不匹配。解决办法是添加一个 <dependencyManagement> 在pom中设置httpclient库的版本以使它们相同。

相关问题