XXX is registering events before it is enabled

Discussion in 'Plugin Development' started by phaed, Mar 6, 2011.

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

    phaed

    Code:
    XXX is registering events before it is enabled. It may be misbehaving and the author needs to fix this.
    When does this happen and why? It seems to be shown to my users at random.
     
  2. Offline

    xZise

    It's when the plugin XXX executes PluginManager.registerEvent() before the onEnabled() method called. But this couldn't be possible, because you only could be sure in the onEnabled() method call, that the plugin manager is defined.

    Fabian
     
  3. Offline

    phaed

    I'm registering events in the onEnabled method, yet ramdomly this appears. Trying to get to the root cause of this.
     
  4. Offline

    xZise

    Okay that could be strange. Maybe a concurrency problem (okay I have no idea if bukkit uses multithreaded somewhere). It could be, that one plugin registers events for another plugin (untested). I have no idea why the plugin should do this, but if all plugins only register events in onEnable() this is the only way. And maybe this could be done indirectly. For example if the disabled plugin has a method “init” which an enabled plugin called. So in this init method the disabled plugin could register events and can cause this warning.

    So is there any pattern visible? For example it only happens if the plugins get enabled in a specific order? Or only one plugin show this warning?

    Fabian
     
Thread Status:
Not open for further replies.

Share This Page