繁体   English   中英

java.lang.NoSuchMethodError:io.netty.buffer.PooledByteBufAllocator.metric()Lio / netty / buffer / PooledByteBufAllocatorMetric;

[英]java.lang.NoSuchMethodError: io.netty.buffer.PooledByteBufAllocator.metric()Lio/netty/buffer/PooledByteBufAllocatorMetric;

我试图用spark运行一个简单的脚本,它给了我

java.lang.NoSuchMethodError:io.netty.buffer.PooledByteBufAllocator.metric()Lio / netty / buffer / PooledByteBufAllocatorMetric;

我在此线程上看到了: Spark 2.3.0网络版本问题:NoSuchMethod io.netty.buffer.PooledByteBufAllocator.metric()

但是即使在我将新的netty模块添加到pom.xml之后,我仍然看到它。 我的pom.xml看起来像这样:

 <dependency>
   <groupId>org.apache.spark</groupId>
   <artifactId>spark-core_2.11</artifactId>
   <version>2.3.0</version>
 </dependency>
 <dependency>
   <groupId>io.netty</groupId>
   <artifactId>netty-all</artifactId>
   <version>4.1.17.Final</version>
 </dependency>

我也尝试过使用spark 2.2.1,但这使我:

java.lang.IllegalArgumentException:要求失败:只能在正在运行的MetricsSystem上调用getServletHandlers

所以我有点卡住了,还有其他可以尝试的配置吗?

因此,这可能会有所帮助。 首先,我不是Java专家,这是我第一次涉足Cassandra / spark。 我认为他们已经从源代码下载中修复了该问题,因为该托管依赖项现在已添加到2.3.0中(我发誓它不像一天前那样,我可能会发疯)。 我也在尝试使用cassandra连接器,而包含这些jar可能是造成我的问题的原因。 无论如何,这是我的docker文件的摘录:

#SPARK
ENV SPARK_COMMIT 992447fb30ee9ebb3cf794f2d06f4d63a2d792db
ENV SPARK_VERSION 2.3.0
ENV SPARK_PREFIX /usr
ENV SPARK_HOME /usr/spark-${SPARK_VERSION}
ENV _R_CHECK_FORCE_SUGGESTS_ false
RUN wget http://apache.claz.org/spark/spark-2.3.0/spark-2.3.0.tgz && tar -xzf spark-2.3.0.tgz -C $SPARK_PREFIX

# COPY ./builds/secondpage-spark/pom.xml $SPARK_HOME/pom.xml

RUN cd $SPARK_HOME && ./dev/make-distribution.sh --name custom-spark --pip --tgz -Phive -Phive-thriftserver -Pyarn -Pkubernetes -DskipTests

# SPARK CASSANDRA CONNECTOR
ENV CONNECTOR_COMMIT d8a3eb4
ENV CONNECTOR_HOME /usr/spark-cassandra-connector
RUN git clone https://github.com/datastax/spark-cassandra-connector $CONNECTOR_HOME && \
cd $CONNECTOR_HOME && git checkout $CONNECTOR_COMMIT && \
sbt/sbt doc && \
sbt/sbt package && \
sbt/sbt assembly

里面有一堆无关紧要的东西,因为我一直在往墙上扔东西,这是第一件事。 这样就可以清洗了,或者您可以将其转换为纯bash

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM