Some weird error

Discussion in 'Plugin Development' started by Lolmewn, Apr 30, 2012.

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

    Lolmewn Retired Staff

    Eh, I started getting this error randomly. Not sure how to fix it.. Maybe you do?
    Error:
    Code:java
    1. 15:58:56 [SEVERE] Error occurred while enabling Skillz vjenkins-Skillz-203 (Is i
    2. t up to date?)
    3. java.lang.NoClassDefFoundError: nl/lolmen/Skillz/Skillz$4
    4. at nl.lolmen.Skillz.Skillz.startUserSavingThread(Skillz.java:526)
    5. at nl.lolmen.Skillz.Skillz.onEnable(Skillz.java:105)
    6. at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:215)
    7. at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader
    8. .java:336)
    9. at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
    10. r.java:381)
    11. at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:250)
    12. at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:232
    13. )
    14. at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:371)
    15. at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:358)
    16. at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:187)
    17. at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:422)
    18. at net.minecraft.server.ThreadServerApplication.run(SourceFile:492)
    19. Caused by: java.lang.ClassNotFoundException: nl.lolmen.Skillz.Skillz$4
    20. at java.net.URLClassLoader$1.run(Unknown Source)
    21. at java.net.URLClassLoader$1.run(Unknown Source)
    22. at java.security.AccessController.doPrivileged(Native Method)
    23. at java.net.URLClassLoader.findClass(Unknown Source)
    24. at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    25. java:41)
    26. at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    27. java:29)
    28. at java.lang.ClassLoader.loadClass(Unknown Source)
    29. at java.lang.ClassLoader.loadClass(Unknown Source)
    30. ... 12 more


    And my code:
    Code:java
    1. @Override
    2. public void onEnable() {
    3. double time = System.nanoTime();
    4. this.makeSettings();
    5. this.loadUserManager();
    6. this.startUserSavingThread();
    7. ...

    Code:java
    1. private void startUserSavingThread() {
    2. this.getServer().getScheduler().scheduleAsyncRepeatingTask(this, new Runnable(){
    3. @Override
    4. public void run() {
    5. getLogger().info("Saving Skillz Users..");
    6. getUserManager().save(true);
    7. }
    8. }, 24000L, 24000L);
    9. }



    The really weird thing is that line 526 from the error isn't in the startUserSavingThread() Method. I'm guessing something got messed up.
    I'm using Maven + Jenkins, and I'm pretty noobie with it. Maybe I configured something wrong in it?
     
  2. Offline

    DeadlyScone

    NoClassDefinitionFound || ClassNotFoundException

    Try surround the trouble areas with a try catch statement and it will tell you exactly where the error is occurring.
     
  3. Offline

    Lolmewn Retired Staff

    I don't see why this would work. I already have a stacktrace, no need to generate another one, right?
     
  4. Offline

    DeadlyScone

    not exactly, unless your hiding the throwable somewhere i would try what i said above then look at it.
     
  5. Offline

    Lolmewn Retired Staff

    Well, seems I 'partially' fixed it. Instead of building it with Jenkins, I built it with Netbeans. It seems Jenkins just uses the wrong data to build my project (eh, don't know how to fix that :O)
     
  6. Offline

    DeadlyScone

    well, glad you partially got it fixed. when errors pop up like that it tells you generally where it is. when you have the try catch it tells you exactly where the error occurs.
     
  7. Offline

    TopGear93

    the no classfound error has been normal for me lately. To fix it i have been leftclicking once on my project and F5 to refresh. Some times ill "Clean" the project and that usually fixes the problems.
     
  8. Offline

    Lolmewn Retired Staff

    Yea that also seemed to work a bit. (Clean)
     
Thread Status:
Not open for further replies.

Share This Page