NoClassDefFoundError when typing command from console

Discussion in 'BungeeCord Plugin Development' started by DipselMedia, Apr 25, 2017.

  1. Hello there,

    I am working on a big plugin and I have encountered the following problem multiple times: When I use a command from my plugin in the command line, I get a NoClassDefFoundError. But when I use the exact same command ingame, it works just fine. The class that is not found is a final class called Resources.
    I recently got the same error with an enum (but only once), and I can't figure out what causes it.

    Here is the error message, even if I can't imagine that it would be any useful:
    Code (Text):
    17:42:41 [SCHWERWIEGEND] Exception in thread "main"
    17:42:41 [SCHWERWIEGEND] java.lang.NoClassDefFoundError: net/dipselmedia/util/Resources
    17:42:41 [SCHWERWIEGEND]        at net.dipselmedia.command.SystemCtl.restart(SystemCtl.java:224)
    17:42:41 [SCHWERWIEGEND]        at net.dipselmedia.command.SystemCtl.execute(SystemCtl.java:70)
    17:42:41 [SCHWERWIEGEND]        at net.md_5.bungee.api.plugin.PluginManager.dispatchCommand(PluginManager.java:169)
    17:42:41 [SCHWERWIEGEND]        at net.md_5.bungee.api.plugin.PluginManager.dispatchCommand(PluginManager.java:116)
    17:42:41 [SCHWERWIEGEND]        at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:62)
    17:42:41 [SCHWERWIEGEND]        at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)
    17:42:41 [SCHWERWIEGEND] Caused by: java.lang.ClassNotFoundException: net.dipselmedia.util.Resources
    17:42:41 [SCHWERWIEGEND]        at net.md_5.bungee.api.plugin.PluginClassloader.loadClass0(PluginClassloader.java:53)
    17:42:41 [SCHWERWIEGEND]        at net.md_5.bungee.api.plugin.PluginClassloader.loadClass(PluginClassloader.java:27)
    17:42:41 [SCHWERWIEGEND]        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    17:42:41 [SCHWERWIEGEND]        ... 6 more
    The interesting thing is that the class that was not found in the command is being accessed by other classes in my plugin all the time, without any issues. Can anyone help me with this mysterious problem? If you need any additional information like some code snippets, just let me know.

    Thanks in advance!
     
    #1 DipselMedia, Apr 25, 2017
    Last edited: Apr 25, 2017
  2. I am not quite sure but I think you registered the Plugin in your main but it can't find the ExecutorClass. Also please show me line 224 and 70 in your "SystemCtrl" class.
     
  3. I curious about this too :)