Minecraft crashes when entering "!chat", because java.lang.NoClassDefFoundError: com/google/code/chatterbotapi/ChatterBotFactory
michaelwechner opened this issue ยท 4 comments
Hi
I have cloned and made a minor modification inside Main.java
-
player.sendMessage(ForgeHooks.newChatWithLinks("You are now chatting with an AI"), (UUID)null);
-
player.sendMessage(ForgeHooks.newChatWithLinks("You are now chatting with a Bot"), (UUID)null);
Then I have built the jar
./gradlew jar
whereas I am using Java 8
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
And I copy build/libs/aichatbot-1.0.jar to the mods folder of the Forge installation.
When I then enter "!chat", the Minecraft crashes (see below)
When I use install aichatbot-1.0.1.jar (from https://www.curseforge.com/minecraft/mc-mods/ai-chatbot/download), then it works very fine.
What am I doing wrong when building the jar file?
Btw, the content of the jar is as follows:
jar -tf build/libs//aichatbot-1.0.jar
META-INF/
META-INF/MANIFEST.MF
net/
net/jacobmc/
net/jacobmc/ai/
net/jacobmc/ai/chatbot/
net/jacobmc/ai/chatbot/Main$2.class
net/jacobmc/ai/chatbot/Main$1.class
net/jacobmc/ai/chatbot/Main$RegistryEvents.class
net/jacobmc/ai/chatbot/Main.class
com/
com/google/
com/google/code/
com/google/code/chatterbotapi/
com/google/code/chatterbotapi/Cleverbot$Session.class
com/google/code/chatterbotapi/Pandorabots$Session.class
com/google/code/chatterbotapi/ChatterBotFactory$1.class
com/google/code/chatterbotapi/ChatterBotThought.class
com/google/code/chatterbotapi/Pandorabots.class
com/google/code/chatterbotapi/ChatterBotSession.class
com/google/code/chatterbotapi/ChatterBotType.class
com/google/code/chatterbotapi/ChatterBotFactory.class
com/google/code/chatterbotapi/ChatterBot.class
com/google/code/chatterbotapi/Utils.class
com/google/code/chatterbotapi/Cleverbot.class
META-INF/mods.toml
pack.mcmeta
---- Minecraft Crash Report ----
// Don't be sad, have a hug! <3
Time: 28.07.21 23:22
Description: keyPressed event handler
java.lang.NoClassDefFoundError: com/google/code/chatterbotapi/ChatterBotFactory
at net.jacobmc.ai.chatbot.Main.onChat(Main.java:57) ~[?:1.0] {re:classloading}
at net.minecraftforge.eventbus.ASMEventHandler_0_Main_onChat_ClientChatEvent.invoke(.dynamic) ~[?:?] {}
at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-4.0.0.jar:?] {}
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?] {}
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {}
at net.minecraftforge.event.ForgeEventFactory.onClientSendMessage(ForgeEventFactory.java:365) ~[?:?] {re:classloading}
at net.minecraft.client.gui.screen.Screen.func_231159_b_(Screen.java:301) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.client.gui.screen.Screen.func_231161_c_(Screen.java:297) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.client.gui.screen.ChatScreen.func_231046_a_(SourceFile:98) ~[?:?] {re:classloading}
at net.minecraft.client.KeyboardListener.lambda$keyPress$4(KeyboardListener.java:302) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.client.gui.screen.Screen.func_231153_a_(Screen.java:427) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.client.KeyboardListener.func_197961_a(KeyboardListener.java:293) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.client.KeyboardListener.func_228003_c_(KeyboardListener.java:391) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.util.concurrent.ThreadTaskExecutor.execute(SourceFile:94) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.client.KeyboardListener.func_228001_b_(KeyboardListener.java:390) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
at org.lwjgl.glfw.GLFWKeyCallbackI.callback(GLFWKeyCallbackI.java:37) ~[lwjgl-glfw-3.2.1.jar:build 12] {}
at org.lwjgl.system.JNI.invokeV(Native Method) ~[lwjgl-3.2.1.jar:build 12] {}
at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3050) ~[lwjgl-glfw-3.2.1.jar:build 12] {}
at com.mojang.blaze3d.systems.RenderSystem.flipFrame(SourceFile:109) ~[?:?] {re:classloading}
at net.minecraft.client.MainWindow.func_227802_e_(MainWindow.java:305) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.client.Minecraft.func_195542_b(Minecraft.java:996) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:607) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.main.Main.main(Main.java:184) ~[1.16.5-forge-36.2.0.jar:?] {re:classloading,pl:runtimedistcleaner:A}
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_74] {}
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_74] {}
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_74] {}
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_74] {}
at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51) ~[forge-1.16.5-36.2.0.jar:36.2] {}
at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {}
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {}
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {}
at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {}
at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {}
Caused by: java.lang.ClassNotFoundException: com.google.code.chatterbotapi.ChatterBotFactory
at java.lang.ClassLoader.findClass(ClassLoader.java:530) ~[?:1.8.0_74] {}
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_74] {}
at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:94) ~[modlauncher-8.0.9.jar:?] {re:classloading}
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_74] {}
... 33 more
A detailed walkthrough of the error, its code path and all known details is as follows:
-- Head --
Thread: Render thread
Stacktrace:
at net.jacobmc.ai.chatbot.Main.onChat(Main.java:57) ~[?:1.0] {re:classloading}
at net.minecraftforge.eventbus.ASMEventHandler_0_Main_onChat_ClientChatEvent.invoke(.dynamic) ~[?:?] {}
at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-4.0.0.jar:?] {}
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?] {}
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {}
at net.minecraftforge.event.ForgeEventFactory.onClientSendMessage(ForgeEventFactory.java:365) ~[?:?] {re:classloading}
at net.minecraft.client.gui.screen.Screen.func_231159_b_(Screen.java:301) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.client.gui.screen.Screen.func_231161_c_(Screen.java:297) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.client.gui.screen.ChatScreen.func_231046_a_(SourceFile:98) ~[?:?] {re:classloading}
at net.minecraft.client.KeyboardListener.lambda$keyPress$4(KeyboardListener.java:302) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
-- Affected screen --
Details:
Screen name: net.minecraft.client.gui.screen.ChatScreen
Stacktrace:
at net.minecraft.client.gui.screen.Screen.func_231153_a_(Screen.java:427) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.client.KeyboardListener.func_197961_a(KeyboardListener.java:293) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.client.KeyboardListener.func_228003_c_(KeyboardListener.java:391) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.util.concurrent.ThreadTaskExecutor.execute(SourceFile:94) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.client.KeyboardListener.func_228001_b_(KeyboardListener.java:390) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
at org.lwjgl.glfw.GLFWKeyCallbackI.callback(GLFWKeyCallbackI.java:37) ~[lwjgl-glfw-3.2.1.jar:build 12] {}
at org.lwjgl.system.JNI.invokeV(Native Method) ~[lwjgl-3.2.1.jar:build 12] {}
at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3050) ~[lwjgl-glfw-3.2.1.jar:build 12] {}
at com.mojang.blaze3d.systems.RenderSystem.flipFrame(SourceFile:109) ~[?:?] {re:classloading}
-- Affected level --
Details:
All players: 1 total; [ClientPlayerEntity['CookyBeast'/231, l='ClientLevel', x=-115.31, y=64.00, z=97.98]]
Chunk stats: Client Chunk Cache: 841, 542
Level dimension: minecraft:overworld
Level spawn location: World: (-80,71,112), Chunk: (at 0,4,0 in -5,7; contains blocks -80,0,112 to -65,255,127), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
Level time: 6959 game time, 6959 day time
Server brand: forge
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.client.world.ClientWorld.func_72914_a(ClientWorld.java:447) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
at net.minecraft.client.Minecraft.func_71396_d(Minecraft.java:2029) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:623) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.client.main.Main.main(Main.java:184) ~[1.16.5-forge-36.2.0.jar:?] {re:classloading,pl:runtimedistcleaner:A}
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_74] {}
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_74] {}
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_74] {}
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_74] {}
at net.minecraftforge.fml.loading.FMLClientLaunchProvider.lambda$launchService$0(FMLClientLaunchProvider.java:51) ~[forge-1.16.5-36.2.0.jar:36.2] {}
at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {}
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {}
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {}
at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {}
at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {}
-- System Details --
Details:
Minecraft Version: 1.16.5
Minecraft Version ID: 1.16.5
Operating System: Mac OS X (x86_64) version 10.14.4
Java Version: 1.8.0_74, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 806246728 bytes (768 MB) / 2147483648 bytes (2048 MB) up to 2147483648 bytes (2048 MB)
CPUs: 12
JVM Flags: 9 total; -Xss1M -XX:+IgnoreUnrecognizedVMOptions -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
ModLauncher: 8.0.9+86+master.3cf110c
ModLauncher launch target: fmlclient
ModLauncher naming: srg
ModLauncher services:
/mixin-0.8.2.jar mixin PLUGINSERVICE
/eventbus-4.0.0.jar eventbus PLUGINSERVICE
/forge-1.16.5-36.2.0.jar object_holder_definalize PLUGINSERVICE
/forge-1.16.5-36.2.0.jar runtime_enum_extender PLUGINSERVICE
/accesstransformers-3.0.1.jar accesstransformer PLUGINSERVICE
/forge-1.16.5-36.2.0.jar capability_inject_definalize PLUGINSERVICE
/forge-1.16.5-36.2.0.jar runtimedistcleaner PLUGINSERVICE
/mixin-0.8.2.jar mixin TRANSFORMATIONSERVICE
/forge-1.16.5-36.2.0.jar fml TRANSFORMATIONSERVICE
FML: 36.2
Forge: net.minecraftforge:36.2.0
FML Language Providers:
[email protected]
minecraft@1
Mod List:
forge-1.16.5-36.2.0-client.jar |Minecraft |minecraft |1.16.5 |DONE |Manifest: NOSIGNATURE
aichatbot-1.0.jar |AI-Chatbot |aichatbot |1.0 |DONE |Manifest: NOSIGNATURE
forge-1.16.5-36.2.0-universal.jar |Forge |forge |36.2.0 |DONE |Manifest: 22:af:21:d8:19:82:7f:93:94:fe:2b:ac:b7:e4:41:57:68:39:87:b1:a7:5c:c6:44:f9:25:74:21:14:f5:0d:90
Crash Report UUID: 5728c82d-26d7-411d-9bea-64011cf27057
Launched Version: 1.16.5-forge-36.2.0
Backend library: LWJGL version 3.2.1 build 12
Backend API: AMD Radeon Pro 555X OpenGL Engine GL version 2.1 ATI-2.8.38, ATI Technologies Inc.
GL Caps: Using framebuffer using ARB_framebuffer_object extension
Using VBOs: Yes
Is Modded: Definitely; Client brand changed to 'forge'
Type: Client (map_client.txt)
GPU Warnings: version: 2.1
Graphics mode: fancy
Resource Packs:
Current Language: English (US)
CPU: 12x Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
When you built the build you have to have the contents of the api inside of your src/java double check you have that.
Thanks for your feedback!
You mean the ChatterBot source?