rutgerkok / WorldGeneratorApi

Minecraft Spigot plugin that enables other plugins to customize world generation
MIT License
96 stars 9 forks source link

org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: nl/rutgerkok/worldgeneratorapi/WorldGeneratorApi #25

Closed TheGreatRambler closed 3 years ago

TheGreatRambler commented 3 years ago

Describe the bug This bug occurs whenever the Spigot plugin is loaded alongside my own plugin.

To Reproduce Steps to reproduce the behavior:

  1. Compile your own world generation plugin for 1.14, manually installing the API jar from release 0.3 into maven
  2. Put that plugin in server plugins
  3. Compile the impl from the source code of release 0.3 and copy that jar into the server plugins
  4. Attempt to start the server
[20:36:03] [Server thread/ERROR]: Could not load 'plugins\WorldGeneratorApi-1.14.4.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: nl/rutgerkok/worldgeneratorapi/WorldGeneratorApi
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:139) ~[spigot_1-14-4.jar:git-Spigot-9de398a-9c887d4]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:334) ~[spigot_1-14-4.jar:git-Spigot-9de398a-9c887d4]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:253) [spigot_1-14-4.jar:git-Spigot-9de398a-9c887d4]
        at org.bukkit.craftbukkit.v1_14_R1.CraftServer.loadPlugins(CraftServer.java:350) [spigot_1-14-4.jar:git-Spigot-9de398a-9c887d4]
        at net.minecraft.server.v1_14_R1.DedicatedServer.init(DedicatedServer.java:194) [spigot_1-14-4.jar:git-Spigot-9de398a-9c887d4]
        at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:776) [spigot_1-14-4.jar:git-Spigot-9de398a-9c887d4]
        at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.NoClassDefFoundError: nl/rutgerkok/worldgeneratorapi/WorldGeneratorApi
        at java.lang.ClassLoader.defineClass1(Native Method) ~[?:?]
        at java.lang.ClassLoader.defineClass(ClassLoader.java:1017) ~[?:?]
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:131) ~[spigot_1-14-4.jar:git-Spigot-9de398a-9c887d4]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:81) ~[spigot_1-14-4.jar:git-Spigot-9de398a-9c887d4]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:589) ~[?:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[?:?]
        at java.lang.Class.forName0(Native Method) ~[?:?]
        at java.lang.Class.forName(Class.java:398) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:59) ~[spigot_1-14-4.jar:git-Spigot-9de398a-9c887d4]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[spigot_1-14-4.jar:git-Spigot-9de398a-9c887d4]
        ... 6 more
Caused by: java.lang.ClassNotFoundException: nl.rutgerkok.worldgeneratorapi.WorldGeneratorApi
        at java.net.URLClassLoader.findClass(URLClassLoader.java:471) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:135) ~[spigot_1-14-4.jar:git-Spigot-9de398a-9c887d4]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:81) ~[spigot_1-14-4.jar:git-Spigot-9de398a-9c887d4]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:589) ~[?:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[?:?]
        at java.lang.ClassLoader.defineClass1(Native Method) ~[?:?]
        at java.lang.ClassLoader.defineClass(ClassLoader.java:1017) ~[?:?]
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:131) ~[spigot_1-14-4.jar:git-Spigot-9de398a-9c887d4]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:81) ~[spigot_1-14-4.jar:git-Spigot-9de398a-9c887d4]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:589) ~[?:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[?:?]
        at java.lang.Class.forName0(Native Method) ~[?:?]
        at java.lang.Class.forName(Class.java:398) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:59) ~[spigot_1-14-4.jar:git-Spigot-9de398a-9c887d4]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[spigot_1-14-4.jar:git-Spigot-9de398a-9c887d4]
        ... 6 more
[20:36:03] [Server thread/ERROR]: Could not load 'plugins\FloatingVillages-1.14.4.jar' in folder 'plugins'
org.bukkit.plugin.UnknownDependencyException: WorldGeneratorApi
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:221) [spigot_1-14-4.jar:git-Spigot-9de398a-9c887d4]
        at org.bukkit.craftbukkit.v1_14_R1.CraftServer.loadPlugins(CraftServer.java:350) [spigot_1-14-4.jar:git-Spigot-9de398a-9c887d4]
        at net.minecraft.server.v1_14_R1.DedicatedServer.init(DedicatedServer.java:194) [spigot_1-14-4.jar:git-Spigot-9de398a-9c887d4]
        at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:776) [spigot_1-14-4.jar:git-Spigot-9de398a-9c887d4]
        at java.lang.Thread.run(Thread.java:834) [?:?]
TheGreatRambler commented 3 years ago

I had to compile the JAR myself because the JAR in the release didn't have a plugin.yaml and the impl in the source code did.

TheGreatRambler commented 3 years ago

I believe I fixed it

TheGreatRambler commented 3 years ago

For anyone planning on using the 1.14 release, you HAVE to compile it yourself. The release build is incomplete