Solved WorldGuard Custom Flag Error

Discussion in 'Plugin Development' started by hellobrad100, Jan 23, 2015.

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

    hellobrad100

    Hi everyone.

    I have made custom flags for WorldGuard before with no issues, however now it just seems to error on start up no matter what I do.

    I'm using the latest WorldGuard and WGCustomFlags plugins, which are being used on my Build path and also present in the "plugins" folder.

    The weird part is that any of my old flags, I can export and they will work fine, any new flags I create just error. So I was wondering if I'm doing something wrong, has anyone come across this error and is there a way for me to fix it? :p

    Here is the error code:
    Code:
    [11:10:16] [Server thread/ERROR]: Could not load 'plugins\BreadFlags.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: com/sk89q/worldguard/protection/flags/Flag
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[craftbukkit.jar:git-Spigot-b8f6402-a646500]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[craftbukkit.jar:git-Spigot-b8f6402-a646500]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [craftbukkit.jar:git-Spigot-b8f6402-a646500]
        at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugins(CraftServer.java:288) [craftbukkit.jar:git-Spigot-b8f6402-a646500]
        at net.minecraft.server.v1_8_R1.DedicatedServer.init(DedicatedServer.java:152) [craftbukkit.jar:git-Spigot-b8f6402-a646500]
        at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:494) [craftbukkit.jar:git-Spigot-b8f6402-a646500]
        at java.lang.Thread.run(Unknown Source) [?:1.7.0_40]
    Caused by: java.lang.NoClassDefFoundError: com/sk89q/worldguard/protection/flags/Flag
        at java.lang.Class.forName0(Native Method) ~[?:1.7.0_40]
        at java.lang.Class.forName(Unknown Source) ~[?:1.7.0_40]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64) ~[craftbukkit.jar:git-Spigot-b8f6402-a646500]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[craftbukkit.jar:git-Spigot-b8f6402-a646500]
        ... 6 more
    Caused by: java.lang.ClassNotFoundException: com.sk89q.worldguard.protection.flags.Flag
        at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.7.0_40]
        at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.7.0_40]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_40]
        at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.7.0_40]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[craftbukkit.jar:git-Spigot-b8f6402-a646500]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[craftbukkit.jar:git-Spigot-b8f6402-a646500]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_40]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_40]
        at java.lang.Class.forName0(Native Method) ~[?:1.7.0_40]
        at java.lang.Class.forName(Unknown Source) ~[?:1.7.0_40]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:64) ~[craftbukkit.jar:git-Spigot-b8f6402-a646500]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[craftbukkit.jar:git-Spigot-b8f6402-a646500]
        ... 6 more
    Thanks,
    Brad
     
  2. Offline

    TGRHavoc

    @hellobrad100
    Looks like the version of WorldGuard you're using doesn't have the "Flag" class (located at com.sk89q.worldguard.protection.flags.Flag) but, your plugin uses said class casing the ClassNotFoundException.
     
  3. Offline

    hellobrad100

    @TGRHavoc
    I assumed that at first, however I have used a few different versions and decompiled the version I was using and saw that it did have the class it says it is missing o.o
     
  4. Offline

    NathanWolf

    Have you made sure your plugin has depends or softdepends in your plugin.yml for WorldGuard?

    Otherwise I think this will happen if Bukkit loads your plugin before it loads WorldGuard.
     
  5. Offline

    hellobrad100

    Ye, got both the depends in the plugin.yml for both WorldGuard and WGCustomFlags

    I am very very disappointed in myself.

    Typeo in the plugin.yml

    Instead of putting:

    Depend: [WorldGuard, WGCustomFlags]

    I put:
    Depends: [WorldGuard, WGCustomFlags]

    That little "s" has been the trouble maker all this time.

    I think I should quit xD

    Thanks for your help anyway guys.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 13, 2016
  6. Offline

    NathanWolf

    I thought it was "depends" too! Glad you found it :)
     
    hellobrad100 likes this.
Thread Status:
Not open for further replies.

Share This Page