Skip to content

java.lang.NoClassDefFoundError: org/apache/commons/lang3/function/TriConsumer #595

Description

@Drullkus

Minecraft Version: 1.20.4

NeoForge Version: 20.4.146

Log:

Disconnection Error [21:02:45] [Netty Server IO #4/ERROR] [minecraft/Connection]: Exception caught in connection io.netty.handler.codec.EncoderException: java.lang.NoClassDefFoundError: org/apache/commons/lang3/function/TriConsumer at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:107) ~[netty-codec-4.1.97.Final.jar%23108!/:4.1.97.Final] {} at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar%23112!/:4.1.97.Final] {} at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:940) ~[netty-transport-4.1.97.Final.jar%23112!/:4.1.97.Final] {} at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:966) ~[netty-transport-4.1.97.Final.jar%23112!/:4.1.97.Final] {} at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:934) ~[netty-transport-4.1.97.Final.jar%23112!/:4.1.97.Final] {} at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:984) ~[netty-transport-4.1.97.Final.jar%23112!/:4.1.97.Final] {} at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1025) ~[netty-transport-4.1.97.Final.jar%23112!/:4.1.97.Final] {} at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:306) ~[netty-transport-4.1.97.Final.jar%23112!/:4.1.97.Final] {} at net.minecraft.network.Connection.doSendPacket(Connection.java:295) ~[server-1.20.4-20231207.154220-srg.jar%23123!/:?] {re:classloading} at net.minecraft.network.Connection.lambda$sendPacket$9(Connection.java:290) ~[server-1.20.4-20231207.154220-srg.jar%23123!/:?] {re:classloading} at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[netty-common-4.1.97.Final.jar%23109!/:4.1.97.Final] {} at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[netty-common-4.1.97.Final.jar%23109!/:4.1.97.Final] {} at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[netty-common-4.1.97.Final.jar%23109!/:4.1.97.Final] {} at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) ~[netty-transport-4.1.97.Final.jar%23112!/:4.1.97.Final] {} at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.97.Final.jar%23109!/:4.1.97.Final] {} at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.97.Final.jar%23109!/:4.1.97.Final] {} at java.lang.Thread.run(Thread.java:833) ~[?:?] {} Caused by: java.lang.NoClassDefFoundError: org/apache/commons/lang3/function/TriConsumer at net.neoforged.neoforge.network.payload.RegistryDataMapSyncPayload.write(RegistryDataMapSyncPayload.java:36) ~[neoforge-20.4.146-beta-universal.jar%23124!/:?] {re:classloading} at net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket.write(ClientboundCustomPayloadPacket.java:111) ~[server-1.20.4-20231207.154220-srg.jar%23123!/:?] {re:classloading,pl:accesstransformer:B} at net.neoforged.neoforge.network.filters.GenericPacketSplitter.encode(GenericPacketSplitter.java:91) ~[neoforge-20.4.146-beta-universal.jar%23124!/:?] {re:classloading} at net.neoforged.neoforge.network.filters.GenericPacketSplitter.encode(GenericPacketSplitter.java:42) ~[neoforge-20.4.146-beta-universal.jar%23124!/:?] {re:classloading} at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:90) ~[netty-codec-4.1.97.Final.jar%23108!/:4.1.97.Final] {} ... 16 more

Steps to Reproduce:

  1. Use MDK to make Neoforged Server
  2. Attempt to connect to new server
  3. Receive disconnect message (may sometimes say something else)

Description of issue:
The Apache library containing TriConsumer does not exist among the Minecraft Server libraries, causing IFriendlyByteBufExtension to crash when classloaded.

It seems that development environments run Apache Commons 3.13, while the server's unix_args.txt references 3.12. However, it seems Triconsumers were added in version 3.13 and thus are missing from the server's classpath due to using version 3.12.

Any server owners looking for a workaround, you will need to open your run script to find your run arguments. You can expect the approximate path of /libraries/net/neoforged/neoforge/<version>/<os>_args.txt for this file. Next, verify that you do have the libraries/org/apache/commons/commons-lang3/3.13.0/commons-lang3-3.13.0.jar library in the Server's libraries, because we'll be adding this jarfile to the server classpaths. Once you find this file, you'll see a big block of text: Change libraries/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar into libraries/org/apache/commons/commons-lang3/3.13.0/commons-lang3-3.13.0.jar, making sure to replace the 12 both in the path and filename. Finally, you're all set to launch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA bug or errortriageNeeds triaging and confirmation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions