Please Help Me, My Plugin Doesn't Load

Discussion in 'Plugin Development' started by Gandalf, Feb 26, 2011.

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

    Gandalf

    It generates a whole set of random errors when it is run, I have out everything into a .zip file.

    May somebody please help me?

    It is a re-code of http://forums.bukkit.org/threads/sec-griefalertr-0-3-logs-record-block-interaction-210.3553/, written to be much cleaner, and Group Manager compatible.

    Updated version with Edward's suggested fixes still the same error...

    <Edit by Moderator: Redacted mediafire url>

    Code:
    2011-02-26 17:54:06 [SEVERE] Could not load plugins\GriefAlertR.jar in plugins:
    null
    org.bukkit.plugin.InvalidPluginException
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:85)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:129)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:94)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:58)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:187)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:174)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:120)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:227)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.ClassNotFoundException: com.bukkit.Batman.GriefAlertR
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:30)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Unknown Source)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:72)
    Thanks in advance :)
     
    Last edited by a moderator: Dec 15, 2016
  2. Offline

    Edward Hand

    It would help if you could show us the errors (or the important bits). That would give a big clue to what is going wrong.
     
  3. Offline

    Gandalf

    Added, I have no idea what is wrong...
     
  4. Offline

    Edward Hand

  5. Offline

    Gandalf

  6. Offline

    Edward Hand

    That's what's causing that error. Fix that problem and the error will go away (make sure both to update the folders in your java project as well as your plugin.yml)
    If you have some different error after that, then come back and we can see if we can fix it.
     
  7. Offline

    Gandalf

    Updated, still the exact same error.....

    Here is the source and the updated JAR...<Edit by Moderator: Redacted mediafire url>

    Can you please try exporting it into a JAR and see if that is what I am doing wrong?
     
    Last edited by a moderator: Dec 15, 2016
  8. Offline

    ndoto

    I'm getting the same error with my plugin as well, actually. It was working previously, but I needed to update it to 1) fix the namespace, 2) remove the stupidly long constructor and 3) change my PlayerListener to use onCommand instead of Event.Type.ON_PLAYER_COMMAND.

    I did 1) and 2) correctly as far as I know, which leads me to believe I screwed something up in changing 3). I'm looking through the Bukkit source at where it says the error is occurring to try to get an idea of what's wrong, but if anybody else has any advice, that would be much appreciated.

    Code:
    22:43:10 [SEVERE] Could not load plugins\CustomHelp.jar in plugins: null
    org.bukkit.plugin.InvalidPluginException
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:80)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:129)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:94)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:59)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:204)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:191)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:131)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:246)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.ClassNotFoundException: us.ndoto.customhelp
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:30)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Unknown Source)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:72)
            ... 8 more
     
  9. Offline

    darknesschaos

    Let us see your yaml files please.
     
  10. Offline

    Gandalf

    Sure,

    name: GriefAlertR
    main: com.Batman.GriefAlertR
    version: .1
     
  11. Offline

    darknesschaos

    try changing your main to:
    main: com.Batman.GriefAlertR.GriefAlertR
     
  12. Offline

    ndoto

    My yaml file was:
    Code:
    name: CustomHelp
    
    main: us.ndoto.customhelp.customhelp
    
    version: 0.2.0
    Which gave the same error as above, so then I tried just:
    Code:
    name: CustomHelp
    
    main: us.ndoto.customhelp
    
    version: 0.2.0
    Which is the one you see in the exception I actually pasted in above.

    I've tried both the Recommended Build 440 Craftbukkit as well as the latest snapshot and could not get it working under either, with either version of the namespace under "main". (EDIT: I should also note that I don't remember exactly what build of Bukkit I used as my external JAR when building the plugin, but it was the most recent snapshot as of noon today.)

    I also noted in another thread that some others were having trouble determining on what builds the entire constructor needed to be done away with, and what builds only the super part of the constructor needed to be deleted, so I also went back and re-added the constructor sans the "super" and tried that under each version (no dice, though, so I re-removed it entirely).

    Any other suggestions would be greatly appreciated. Let me know what other info I can provide to help.
     
  13. Offline

    darknesschaos

    I'm guessing that if you have today's build, the constructor is not needed.
     
  14. Offline

    Gandalf

    Do I just rename the .yml file or my packages as well?
     
  15. Offline

    Saturisk

    You have to rename the package. What it's basically saying here is your package name with main class 'GriefAlert'. it's needed to run the plugin in a server since the last update of bukkit if im correct
     
  16. Offline

    Gandalf

    I tried both, neither fixed the problem. I appreciate if someone could review my code, and try to see if anything is wrong there.
     
  17. Offline

    Saturisk

    Could you show us some updated code? Without the constructor, and the package name fixed.
     
  18. Offline

    fullwall

    Looks like you've misnamed either a class or object name.
     
  19. Offline

    gnftoxic

    1. The "com.bukkit...." is blocked, "org.bukkit...." as well.
    2. In your YAML file, you need the "main:" to point to your full package path and main file, e.g. net.hailxenu.stats.XenuStats (XenuStats being the file that contains onEnable() and onDisable()).
     
  20. Offline

    DiaAWAY

    PLAYER_COMMAND is now finally removed (after being deprecated for about a month, i think?), try removing:

    pm.registerEvent(Event.Type.PLAYER_COMMAND, this.playerListener,Event.Priority.Normal, this);
     
  21. Offline

    Saturisk

    No, PLAYER_COMMAND is removed in the latest builds, he has older versions so it should still work
     
Thread Status:
Not open for further replies.

Share This Page