运行OffsetApp03这个类的时候出现
Exception in thread "main" java.lang.NoSuchMethodError: io.netty.buffer.PooledByteBufAllocator.defaultUseCacheForAllThreads()Z at org.apache.spark.network.util.NettyUtils.createPooledByteBufAllocator(NettyUtils.java:168) at org.apache.spark.network.util.NettyUtils.getSharedPooledByteBufAllocator(NettyUtils.java:138) at org.apache.spark.network.server.TransportServer.<init>(TransportServer.java:74) at org.apache.spark.network.TransportContext.createServer(TransportContext.java:157) at org.apache.spark.rpc.netty.NettyRpcEnv.startServer(NettyRpcEnv.scala:125) at org.apache.spark.rpc.netty.NettyRpcEnvFactory.$anonfun$create$1(NettyRpcEnv.scala:489) at org.apache.spark.rpc.netty.NettyRpcEnvFactory.$anonfun$create$1$adapted(NettyRpcEnv.scala:488) at org.apache.spark.util.Utils$.$anonfun$startServiceOnPort$2(Utils.scala:2256) at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:158) at org.apache.spark.util.Utils$.startServiceOnPort(Utils.scala:2248) at org.apache.spark.rpc.netty.NettyRpcEnvFactory.create(NettyRpcEnv.scala:493) at org.apache.spark.rpc.RpcEnv$.create(RpcEnv.scala:57) at org.apache.spark.SparkEnv$.create(SparkEnv.scala:266) at org.apache.spark.SparkEnv$.createDriverEnv(SparkEnv.scala:189) at org.apache.spark.SparkContext.createSparkEnv(SparkContext.scala:267) at org.apache.spark.SparkContext.<init>(SparkContext.scala:442) at org.apache.spark.streaming.StreamingContext$.createNewSparkContext(StreamingContext.scala:851) at org.apache.spark.streaming.StreamingContext.<init>(StreamingContext.scala:85) at com.imooc.bigdata.offset.OffsetApp03$.main(OffsetApp03.scala:22) at com.imooc.bigdata.offset.OffsetApp03.main(OffsetApp03.scala) Disconnected from the target VM, address: '127.0.0.1:64956', transport: 'socket'
貌似是显示是netty的版本冲突,但我搜遍了项目里的代码貌似也没有netty相关的pom包,您的代码里有涉及netty的东西吗?(我的Kafka已能正常启动,Kafka的IP和端口也没有写错,kafka里也有my-replicated-topic这个topic)请问是什么原因呢?