Solved Error when updating to Craftbukkit 1.7.2-R0.3

Discussion in 'Plugin Development' started by bramdv, Feb 16, 2014.

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

    bramdv

    Hi!
    My plugin worked perfectly until the new beta build Craftbukkit 1.7.2-R0.3. My plugin returns this on starting up:

    Code:
    [19:45:25 ERROR]: Error occurred while enabling MrShout v2.1 (Is it up to date?)
    java.lang.IllegalArgumentException: Plugin already initialized!
        at org.bukkit.plugin.java.PluginClassLoader.initialize(PluginClassLoader.java:98) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at org.bukkit.plugin.java.JavaPlugin.<init>(JavaPlugin.java:59) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at com.bramdv.MrShout.MrShout.<init>(MrShout.java:13) ~[?:?]
        at com.bramdv.MrShout.Upgrade.<init>(Upgrade.java:11) ~[?:?]
        at com.bramdv.MrShout.MrShout.onEnable(MrShout.java:22) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:250) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:350) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:389) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at org.bukkit.craftbukkit.v1_7_R1.CraftServer.loadPlugin(CraftServer.java:439) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at org.bukkit.craftbukkit.v1_7_R1.CraftServer.enablePlugins(CraftServer.java:375) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at net.minecraft.server.v1_7_R1.MinecraftServer.m(MinecraftServer.java:342) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at net.minecraft.server.v1_7_R1.MinecraftServer.g(MinecraftServer.java:319) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at net.minecraft.server.v1_7_R1.MinecraftServer.a(MinecraftServer.java:275) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at net.minecraft.server.v1_7_R1.DedicatedServer.init(DedicatedServer.java:175) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:424) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
    Caused by: java.lang.IllegalStateException: Initial initialization
        at org.bukkit.plugin.java.PluginClassLoader.initialize(PluginClassLoader.java:101) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at org.bukkit.plugin.java.JavaPlugin.<init>(JavaPlugin.java:59) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at com.bramdv.MrShout.MrShout.<init>(MrShout.java:13) ~[?:?]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.7.0_51]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[?:1.7.0_51]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.7.0_51]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[?:1.7.0_51]
        at java.lang.Class.newInstance(Class.java:374) ~[?:1.7.0_51]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:52) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:133) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:313) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:236) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at org.bukkit.craftbukkit.v1_7_R1.CraftServer.loadPlugins(CraftServer.java:350) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at org.bukkit.craftbukkit.v1_7_R1.CraftServer.<init>(CraftServer.java:312) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at net.minecraft.server.v1_7_R1.PlayerList.<init>(PlayerList.java:63) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at net.minecraft.server.v1_7_R1.DedicatedPlayerList.<init>(SourceFile:14) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        at net.minecraft.server.v1_7_R1.DedicatedServer.init(DedicatedServer.java:126) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
        ... 2 more
    
    And when executing a command it returns the "usage" from my plugin.yml.
    I checked my syntax and there are no errors :(
    Source here
     
  2. Offline

    Timbals

    Remove the final modifier in your class!
     
  3. Offline

    bramdv

    Done, but still the same error :')
     
  4. Offline

    clienthax

    are you calling "new pluginclasscrap()" ? on your main calss extending javaplugin
     
  5. Offline

    bramdv

    Looks like it
     
  6. Offline

    clienthax

    that would be the reason then, set the instance to "this" in onenable instead of creating a new instance
     
  7. Offline

    bramdv

    Thank you for responding. Why can't I just create a new instance and how do I fix this?
     
  8. Offline

    tincopper2

    Create a new class.
     
  9. Offline

    xTrollxDudex

    bramdv
    Bukkit doesn't allow multiple instantiations of JavaPlugin.

    As said by clienthax, use the this keyword instead of a new instance.
     
  10. Offline

    bramdv

    Whoops, looks like I made a mistake in the other classes with my constructor :') Works perfectly now. Thanks anyway!
     
  11. Offline

    tincopper2

    I like how most errors are problems right in front of us. We just need to look more, that is all.
     
Thread Status:
Not open for further replies.

Share This Page