[Solved] How can I fix this?

Discussion in 'Spigot Plugin Development' started by TimeVisualSales, May 16, 2015.

Thread Status:
Not open for further replies.
  1. Hi there, when I export my project it generates a random file with CLASSNAME$1 does anyone know how to fix this?
    Code (Text):
    [17:42:20] [Server thread/WARN]: [InfectionMC] Task #5 for InfectionMC v0.1 generated an exception
    java.lang.NoClassDefFoundError: net/minecraft/server/v1_8_R2/Packet
    at me.xxdeadlyblazexx.infection.countdown.Lobby$3.run(Lobby.java:120) ~[?:?]
    at org.bukkit.craftbukkit.v1_8_R1.scheduler.CraftTask.run(CraftTask.java:71) ~[spigotmc.jar:git-Spigot-c3c767f-33d5de3]
    at org.bukkit.craftbukkit.v1_8_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350) [spigotmc.jar:git-Spigot-c3c767f-33d5de3]
    at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:709) [spigotmc.jar:git-Spigot-c3c767f-33d5de3]
    at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:316) [spigotmc.jar:git-Spigot-c3c767f-33d5de3]
    at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:634) [spigotmc.jar:git-Spigot-c3c767f-33d5de3]
    at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:537) [spigotmc.jar:git-Spigot-c3c767f-33d5de3]
    at java.lang.Thread.run(Thread.java:745) [?:1.7.0_72]
    Caused by: java.lang.ClassNotFoundException: net.minecraft.server.v1_8_R2.Packet
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:91) ~[spigotmc.jar:git-Spigot-c3c767f-33d5de3]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[spigotmc.jar:git-Spigot-c3c767f-33d5de3]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[?:1.7.0_72]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[?:1.7.0_72]
    ... 8 more
     
     
  2. That's normal. For examples of what leads to it have a look at this stackoverflow post.
     
  3. Its coming up with that error though above...
     
  4. Sure, but that exception is unrelated to the generation of the different class-files. As the exception aptly states, it can't find

    "java.lang.NoClassDefFoundError: net/minecraft/server/v1_8_R2/Packet"

    That would lead one to believe you're not using the same spigot version that you're compiling against.
     
  5. Yeah, I know that but why does it says
    Code (Text):
    me.xxdeadlyblazexx.infection.countdown.Lobby$3.run(Lobby.java:120)
     
  6. Hard to tell without your code ;) But basically, I'd assume it's because you do something around line 120 in an anonymous inner class, which is the third that the compiler generated for the file overall, so it gives you the $3 behind Lobby. Seeing as the method is called run, one would further speculate that that anonymous class is the one you're generating for some sort of ScheduledTask.
     
  7. It's working now, thats strange o_O
     
Thread Status:
Not open for further replies.