java.lang.NoClassDefFoundError issues - Voltz server plugin

Discussion in 'Plugin Development' started by JTGaming2012, Feb 1, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    JTGaming2012

    Hello all, thankyou for taking your time to read this, I really appreciate it :D

    Anyway, firstly I'd like to apoligise if I have posted this on the wrong forum because it's a Voltz server I am running but after checking the Voltz forums, they didn't really have any sections for plugin development errors so I decided to post here anyway.

    So I have coded a plugin, tested it on my regular Minecraft server with the Spigot-1.8.8.jar, everything works fine, loads like it should do.

    I then test it on my Voltz server and the plugin loads correctly, however, where ever I have imported another class of my creation, the plugin will say, java.lang.NoClassDefFoundError: me/jack/warzone/<my class>

    If it helps, here is the full error:

    Code:
    23:08:14 [SEVERE] Error occurred while enabling Warzone v1.0 (Is it up to date?)
    java.lang.NoClassDefFoundError: me/jack/warzone/game/Faction
            at me.jack.warzone.Warzone.onEnable(Warzone.java:26)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:384)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:383)
            at org.bukkit.craftbukkit.v1_5_R3.CraftServer.loadPlugin(CraftServer.java:303)
            at org.bukkit.craftbukkit.v1_5_R3.CraftServer.enablePlugins(CraftServer.java:285)
            at net.minecraft.server.MinecraftServer.func_71243_i(MinecraftServer.java:479)
            at net.minecraft.server.MinecraftServer.func_71222_d(MinecraftServer.java:445)
            at net.minecraft.server.MinecraftServer.func_71247_a(MinecraftServer.java:385)
            at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:214)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:588)
            at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:573)
    Caused by: java.lang.ClassNotFoundException: Failed to remap class me.jack.warzone.game.Faction
            at org.bukkit.plugin.java.PluginClassLoader.remappedFindClass(PluginClassLoader.java:448)
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:362)
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:338)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
            ... 12 more
    Caused by: java.lang.IllegalArgumentException
            at org.objectweb.asm.ClassReader.<init>(ClassReader.java:170)
            at org.objectweb.asm.ClassReader.<init>(ClassReader.java:153)
            at org.objectweb.asm.ClassReader.<init>(ClassReader.java:436)
            at net.md_5.specialsource.repo.RuntimeRepo.findClass0(RuntimeRepo.java:48)
            at net.md_5.specialsource.repo.CachingRepo.findClass(CachingRepo.java:46)
            at net.md_5.specialsource.UnsortedRemappingMethodAdapter.findAccess(UnsortedRemappingMethodAdapter.java:128)
            at net.md_5.specialsource.UnsortedRemappingMethodAdapter.findAccess(UnsortedRemappingMethodAdapter.java:156)
            at net.md_5.specialsource.UnsortedRemappingMethodAdapter.visitMethodInsn(UnsortedRemappingMethodAdapter.java:168)
            at org.objectweb.asm.MethodVisitor.visitMethodInsn(MethodVisitor.java:382)
            at org.objectweb.asm.ClassReader.readCode(ClassReader.java:1320)
            at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:938)
            at org.objectweb.asm.ClassReader.accept(ClassReader.java:669)
            at org.objectweb.asm.ClassReader.accept(ClassReader.java:506)
            at net.md_5.specialsource.JarRemapper.remapClassFile(JarRemapper.java:241)
            at net.md_5.specialsource.JarRemapper.remapClassFile(JarRemapper.java:227)
            at org.bukkit.plugin.java.PluginClassLoader.remappedFindClass(PluginClassLoader.java:413)
            ... 16 more
    
    I have done some research and I understand the gist of what the problem is (classes being found at compile time but not found at runtime), but the fact that the issue is so broad causes me difficulty when searching for someone's issue similar to my own. Solutions other people have found aren't really relevant to my own plugin.

    In my build path, I have the 1.5.2 version of McPc+. Also tried it with Spigot-1.8.8.jar with the same error. So where have I gone wrong?

    Thankyou for your help, any suggestions are greatly appreciated, and again I apologise if this is posted on the wrong forum.
     
  2. Offline

    mythbusterma

    @JTGaming2012

    We don't support MCPC+ here. Seek help on the cauldron forums.

    If the error exists on Spigot or Bukkit as well, this is likely due to you not including the compiled output of the other classes into the jarfile, or including them at the wrong path. Examine the contents of your jarfile using a standard unzipping tool.
     
Thread Status:
Not open for further replies.

Share This Page