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(
    17:42:41 [SCHWERWIEGEND]        at net.dipselmedia.command.SystemCtl.execute(
    17:42:41 [SCHWERWIEGEND]        at net.md_5.bungee.api.plugin.PluginManager.dispatchCommand(
    17:42:41 [SCHWERWIEGEND]        at net.md_5.bungee.api.plugin.PluginManager.dispatchCommand(
    17:42:41 [SCHWERWIEGEND]        at net.md_5.bungee.BungeeCordLauncher.main(
    17:42:41 [SCHWERWIEGEND]        at net.md_5.bungee.Bootstrap.main(
    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(
    17:42:41 [SCHWERWIEGEND]        at net.md_5.bungee.api.plugin.PluginClassloader.loadClass(
    17:42:41 [SCHWERWIEGEND]        at java.lang.ClassLoader.loadClass(
    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 :)