【发布时间】:2017-10-25 16:57:28
【问题描述】:
我在运行我的 flink 程序时遇到了一些问题,这是错误:
java.lang.NoSuchMethodError: io.netty.buffer.CompositeByteBuf.addComponents(ZLjava/lang/Iterable;)Lio/netty/buffer/CompositeByteBuf;
at org.elasticsearch.transport.netty4.Netty4Utils.toByteBuf(Netty4Utils.java:78)
at org.elasticsearch.transport.netty4.Netty4Transport.sendMessage(Netty4Transport.java:449)
at org.elasticsearch.transport.netty4.Netty4Transport.sendMessage(Netty4Transport.java:91)
at org.elasticsearch.transport.TcpTransport$ScheduledPing.doRunInLifecycle(TcpTransport.java:261)
at org.elasticsearch.common.util.concurrent.AbstractLifecycleRunnable.doRun(AbstractLifecycleRunnable.java:67)
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:527)
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
我查看了 SO,发现有人遇到了同样的问题,建议是遮住 netty,我将它包含在我的 pom 中:
这是我添加的内容:
<build>
<plugins>
<!-- disable the exclusion rules -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<excludes combine.self="override">
<exclude>io.netty:netty-all</exclude>
<exclude>io.netty:netty</exclude>
</excludes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
但问题仍然存在。如果有人有想法,请与我分享,谢谢。
【问题讨论】:
-
你能发布你的pom吗?
-
这里是我的 pom 的链接:link
-
你能把
mvn dependency:tree的输出粘贴到包含pom.xml文件的项目目录中吗
标签: java maven elasticsearch apache-flink flink-streaming