Ban plugin help please!

Discussion in 'Plugin Development' started by Compelix, Jun 4, 2016.

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

    Compelix

    Hello. I'm getting this Error whenever my custom plugin loads into the server. Please help!


    [11:58:00] [Server thread/ERROR]: Could not load 'plugins/CompBan.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: Cannot find main class `me.compelix.CompBan.CompBan'
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:42) ~[craftbukkit_1.9.4.jar:git-Bukkit-c5e9a16]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:129) ~[craftbukkit_1.9.4.jar:git-Bukkit-c5e9a16]
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:328) ~[craftbukkit_1.9.4.jar:git-Bukkit-c5e9a16]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [craftbukkit_1.9.4.jar:git-Bukkit-c5e9a16]
    at org.bukkit.craftbukkit.v1_9_R2.CraftServer.loadPlugins(CraftServer.java:293) [craftbukkit_1.9.4.jar:git-Bukkit-c5e9a16]
    at org.bukkit.craftbukkit.v1_9_R2.CraftServer.<init>(CraftServer.java:255) [craftbukkit_1.9.4.jar:git-Bukkit-c5e9a16]
    at net.minecraft.server.v1_9_R2.PlayerList.<init>(PlayerList.java:70) [craftbukkit_1.9.4.jar:git-Bukkit-c5e9a16]
    at net.minecraft.server.v1_9_R2.DedicatedPlayerList.<init>(SourceFile:14) [craftbukkit_1.9.4.jar:git-Bukkit-c5e9a16]
    at net.minecraft.server.v1_9_R2.DedicatedServer.init(DedicatedServer.java:181) [craftbukkit_1.9.4.jar:git-Bukkit-c5e9a16]
    at net.minecraft.server.v1_9_R2.MinecraftServer.run(MinecraftServer.java:510) [craftbukkit_1.9.4.jar:git-Bukkit-c5e9a16]
    at java.lang.Thread.run(Unknown Source) [?:1.7.0_51]
    Caused by: java.lang.ClassNotFoundException: me.compelix.CompBan.CompBan
    at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.7.0_51]
    at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.7.0_51]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_51]
    at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.7.0_51]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:77) ~[craftbukkit_1.9.4.jar:git-Bukkit-c5e9a16]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:62) ~[craftbukkit_1.9.4.jar:git-Bukkit-c5e9a16]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_51]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_51]
    at java.lang.Class.forName0(Native Method) ~[?:1.7.0_51]
    at java.lang.Class.forName(Unknown Source) ~[?:1.7.0_51]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:40) ~[craftbukkit_1.9.4.jar:git-Bukkit-c5e9a16]
    ... 10 more
     
  2. Hello!

    I think that there's a bug with this plugin.
    If this plugin is yours, make sure that you've given the correct path to your main class in the plugin.yml.
    You've maybe made an case-sesnitive error.
    If this plugin isn't yours, then don't use it.

    Example ( plugin.yml ) :
    Code:
    name: CompBan
    version: 1.0
    main: me.compelix.CompBan.CompBan
    ...

    while maybe your package is:

    me.compelix.compban.CompBan

    If this, isn't the thing, please write in what you've typen in the plugin.yml
     
  3. Offline

    Compelix

    I'll try :) Yes. This is my plugin I made this morning w/ nothing to do. I'll let you know if it works.

    Okay so. I did that and it still doesn't work.

    name: CompBan
    author: compelix
    version: 1.0
    main: me.compelix.compban.CompBan
    commands:
    cban:
    description: Bans a specified user!
    ckick:
    description: Kicks a specified user!


    That is my plugin.yml

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

    Zombie_Striker

    Do you see a difference? Note that the third section is Capitialized in the error message, while the main class from the plugin.yml is lowercase. To solve this problem, make sure the packagename for the class is the same as the one specified in the plugin.yml.
     
  5. Offline

    Compelix

    • Don't take the conversation off thread.
    Hello, I tried to do that. I think there's a different issue. Is it possible I can skype someone and screenshare to help fix this issue?
     
  6. Offline

    Zombie_Striker

    @Compelix
    There is no reason to take this issue off of the main thread. The reason you are getting this error is because the server cannot find a file under that file address. Just post the actual package your main class is in along with the updated plugin.yml (if you have updated it), and make sure those two are the same. If it turns out that they are the same, then you should post your main class here. That way, we can see if there is anything wrong with the class itself.
     
  7. @Compelix You have only 1 class in your project which extends JavaPlugin. You have to copy the name of its package, past it into the config and add the name of the class to the end. You have to enter the correct path. For example if your projectstructure looks like this:
    Code:
    Project
      src
        me
          compelix
            compban
               CompBan.java
    You have to take everything from the src-folder on as the path. Your path would look like this then:
    Code:
    me.compelix.compban.CompBan
    And this is what you have to enter for you main-value in your plugin.yml. Ofc not exactly what i wrote here but what fits for your project. So just go to your project, check the path of your main-class and put it in there :)
     
Thread Status:
Not open for further replies.

Share This Page