Plugin would not load.

Discussion in 'Spigot Plugin Development' started by wouterske23, May 28, 2015.

  1. When I try to load my custom made plugin I get this error:
    28.05 20:02:25 [Server] INFO at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:76) ~[server.jar:git-Spigot-1d14d5f-ba32592]
    28.05 20:02:25 [Server] INFO at java.lang.Class.newInstance(Class.java:374) ~[?:1.7.0_55]
    28.05 20:02:25 [Server] INFO at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[?:1.7.0_55]
    28.05 20:02:25 [Server] INFO at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.7.0_55]
    28.05 20:02:25 [Server] INFO at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[?:1.7.0_55]
    28.05 20:02:25 [Server] INFO at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.7.0_55]
    28.05 20:02:25 [Server] INFO at be.thijswouters.Main.<init>(Main.java:13) ~[?:?]
    28.05 20:02:25 [Server] INFO at org.bukkit.plugin.java.JavaPlugin.<init>(JavaPlugin.java:66) ~[server.jar:git-Spigot-1d14d5f-ba32592]
    28.05 20:02:25 [Server] INFO at org.bukkit.plugin.java.PluginClassLoader.initialize(PluginClassLoader.java:122) ~[server.jar:git-Spigot-1d14d5f-ba32592]
    28.05 20:02:25 [Server] INFO Caused by: java.lang.IllegalArgumentException: Plugin already initialized!
    28.05 20:02:25 [Server] INFO at java.lang.Thread.run(Thread.java:744) [?:1.7.0_55]
    28.05 20:02:25 [Server] INFO at net.minecraft.server.v1_8_R2.MinecraftServer.run(MinecraftServer.java:522) [server.jar:git-Spigot-1d14d5f-ba32592]
    28.05 20:02:25 [Server] INFO at net.minecraft.server.v1_8_R2.DedicatedServer.init(DedicatedServer.java:199) [server.jar:git-Spigot-1d14d5f-ba32592]
    28.05 20:02:25 [Server] INFO at org.bukkit.craftbukkit.v1_8_R2.CraftServer.loadPlugins(CraftServer.java:291) [server.jar:git-Spigot-1d14d5f-ba32592]
    28.05 20:02:25 [Server] INFO at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [server.jar:git-Spigot-1d14d5f-ba32592]
    28.05 20:02:25 [Server] INFO at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[server.jar:git-Spigot-1d14d5f-ba32592]
    28.05 20:02:25 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[server.jar:git-Spigot-1d14d5f-ba32592]
    28.05 20:02:25 [Server] INFO org.bukkit.plugin.InvalidPluginException: java.lang.IllegalArgumentException: Plugin already initialized!
    28.05 20:02:25 [Server] ERROR Could not load 'plugins/BucketHub.jar' in folder 'plugins'

    Does someone know what this means?
     

    Attached Files:

  2. Maybe you have 2 plugins with the same name and code?
     
    • Agree Agree x 1
    • Friendly Friendly x 1
  3. Nope that's not the problem :c.
     
  4. [Server] INFO Caused by: java.lang.IllegalArgumentException: Plugin already initialized!
     
  5. There is no plugin with the same name, code,... And I've changed the name in the plugin.yml a million times to try.
     
  6. There's a reason package names should be unique for each plugin. You have two plugins which have a class be.thijswouters.Main, which Java/Bukkit views as the same class. You should use a package name like be.thijswouters.<project name>.Main, as it's less likely to clash with other plugins.
     
    • Agree Agree x 1
  7. Or do you have more than one class extending JavaPlugin or do you have a class extending the main class? That always throws an error in your face :/
     
    • Agree Agree x 1