io.netty.handler.codec.EncoderException: java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [B


Solutions on the web

Solution icon of github
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [B

Solution icon of web
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer

Solution icon of github
java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.Byte

Solution icon of github
java.lang.ClassCastException: net.minecraft.item.ItemStack cannot be cast to java.lang.Short

Stack trace

io.netty.handler.codec.EncoderException: java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [B
	at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:107)
	at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:633)
	at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:691)
	at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:626)
	at io.netty.handler.timeout.IdleStateHandler.write(IdleStateHandler.java:284)
	at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:633)
	at io.netty.channel.AbstractChannelHandlerContext.access$1900(AbstractChannelHandlerContext.java:32)
	at io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.write(AbstractChannelHandlerContext.java:908)
	at io.netty.channel.AbstractChannelHandlerContext$WriteAndFlushTask.write(AbstractChannelHandlerContext.java:960)
	at io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.run(AbstractChannelHandlerContext.java:893)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:357)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)
	at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [B
	at io.netty.buffer.PooledHeapByteBuf._setLong(PooledHeapByteBuf.java:185)
	at io.netty.buffer.AbstractByteBuf.writeLong(AbstractByteBuf.java:791)
	at org.apache.spark.network.protocol.MessageEncoder.encode(MessageEncoder.java:79)
	at org.apache.spark.network.protocol.MessageEncoder.encode(MessageEncoder.java:33)
	at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:89)
	... 13 more

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.