Could not load plugin?

Discussion in 'Plugin Development' started by Matthu699, Jul 20, 2013.

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

    Matthu699

    I decided to mess around with a plugin and i keep getting this error any ideas why?
    I was thinking maybe it was a Java 7 issue.


    21:57:28 [SEVERE] Could not load 'plugins/Facepalm.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.ClassNotFoundException: me.Browning98.com
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:184)
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:305)
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:230)
    at org.bukkit.craftbukkit.v1_6_R2.CraftServer.loadPlugins(CraftServer.java:239)
    at org.bukkit.craftbukkit.v1_6_R2.CraftServer.reload(CraftServer.java:603)
    at org.bukkit.Bukkit.reload(Bukkit.java:275)
    at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:23)
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:189)
    at org.bukkit.craftbukkit.v1_6_R2.CraftServer.dispatchCommand(CraftServer.java:523)
    at org.bukkit.craftbukkit.v1_6_R2.CraftServer.dispatchServerCommand(CraftServer.java:512)
    at net.minecraft.server.v1_6_R2.DedicatedServer.ar(DedicatedServer.java:262)
    at net.minecraft.server.v1_6_R2.DedicatedServer.t(DedicatedServer.java:227)
    at net.minecraft.server.v1_6_R2.MinecraftServer.s(MinecraftServer.java:486)
    at net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java:419)
    at net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:582)
    Caused by: java.lang.ClassNotFoundException: me.Browning98.com
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader.java:80)
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:53)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:249)
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:173)
    ... 14 more
     
  2. Offline

    StrangeOne101

    Your plugin.yml is slightly wrong, dude. Where is says
    Code:
    main: me.Browning98.com
    Add a ".YourPluginHere" to the end of it. "YourPluginHere" being the name of your main plugin class.
     
  3. Offline

    Matthu699

    I will try it now

    I still get the same Error

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

    Miner_Fil

    What is your Package Name and your Main Class File Name?

    If you didn't know, your Main Class File is where you have the onEnable and onDisable methods.
     
  5. Offline

    Matthu699

    Package name is me.browning98.Facepalm
    Main Class Files is Main.java
     
  6. Offline

    ERROR372

  7. Offline

    Matthu699

    name: Facepalm
    version: 1.0
    main: me.Browning98.Facepalm
     
  8. Offline

    psanker

    What is the package of the main class?
     
  9. Offline

    Matthu699

    me.Browning98.Facepalm
     
  10. Offline

    psanker

    Then the "main" line of the plugin.yml file should be "me.Browning98.Facepalm.Facepalm".
     
  11. Offline

    Matthu699

    I will try it
     
  12. Offline

    ERROR372

    Matthu699

    if your package name is "me.Browning98.com" like the error says... and your main class (the one that extends JavaPlugin) is FacePalm, your plugin.yml should look like:

    name: Facepalm
    version: 1.0
    main: me.Browning98.com.FacePalm

    if the package name is "me.Browning.FacePalm" and your main class is FacePalm, your plugin.yml should look like:

    name: Facepalm
    version: 1.0
    main: me.Browning98.Facepalm.FacePalm


    Remember it's always:

    main: packagename.mainclassname
     
  13. Offline

    Matthu699

    I changed it to me.Browning98.Facepalm to see if it would work. But still nothing

    This is my current plugin.yml

    name: Facepalm
    version: 1.0
    main: me.Browning98.Facepalm.Facepalm

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

    Compressions

    These are the kind of people I am reluctant to help...
     
  15. Offline

    Matthu699

    Feel kinda stupid but the Main was suppose to me me.Browning98.Facepalm.Main
     
  16. Offline

    BuckitWorker

    I don't get it. I am having the same problem but I do not have a plugin.yml!
     
  17. Offline

    general656

  18. Offline

    Cammeritz

    Matthu699 try this:

    name: Facepalm
    author: Cammeritz
    description: Facepalms you, YOLO
    version: 1.0
    database: false

    main: me.Browning98.Facepalm.(Your Main .class [with onEnable])
     
    Peter_Higgs likes this.
  19. Offline

    Peter_Higgs

    I am having the same problem, but I am thinking that it might be something in the onEnable(), since (correct me if I am wrong) this is where your plugin is loaded.
    Here is my onEnable():
    Code:java
    1. public void onEnable(){
    2.  
    3. //Meta Data
    4. ItemMeta fireKniveMeta = fireKnive.getItemMeta();
    5. //lore
    6. List<String> fireLore = new ArrayList<String>();
    7. fireLore.add(ChatColor.GOLD +"This is a disguised throwing knife.");
    8. fireLore.add(ChatColor.RED +"Boom, Boom, Fia Powa!!!");
    9. fireLore.add(ChatColor.BLUE +"+ ∞ damage");
    10. fireKniveMeta.setLore(fireLore);
    11. //lore end
    12. //rename
    13. fireKniveMeta.setDisplayName(ChatColor.RED +"Throwing " +ChatColor.BLUE +" Knive");
    14. //rename ends
    15. //enchants
    16. fireKniveMeta.addEnchant(Enchantment.KNOCKBACK, 100, true);
    17. fireKniveMeta.addEnchant(Enchantment.FIRE_ASPECT, 100, true);
    18. fireKniveMeta.addEnchant(Enchantment.LOOT_BONUS_MOBS, 100, true);
    19. fireKniveMeta.addEnchant(Enchantment.DAMAGE_ALL, 20, true);
    20. //enchants end
    21. fireKnive.setItemMeta(fireKniveMeta);
    22. //Meta Data end
    23. //Recipe
    24. ShapedRecipe fireKniveRecipe = new ShapedRecipe(fireKnive);
    25. fireKniveRecipe.shape("BBB","RIR","PSP");
    26. fireKniveRecipe.setIngredient('P', Material.POWERED_RAIL);
    27. fireKniveRecipe.setIngredient('R', Material.REDSTONE);
    28. fireKniveRecipe.setIngredient('B', Material.BLAZE_POWDER);
    29. fireKniveRecipe.setIngredient('I', Material.IRON_INGOT);
    30. fireKniveRecipe.setIngredient('S', Material.BLAZE_ROD);
    31. //Recipe End
    32.  
    33. //Meta Data
    34. ItemMeta kniveMeta = knive.getItemMeta();
    35. //lore
    36. List<String> lore = new ArrayList<String>();
    37. lore.add(ChatColor.GOLD +"This is a disguised throwing knife.");
    38. lore.add(ChatColor.GREEN +":) :) :) :) :) :) :) :) :) :) :)");
    39. lore.add(ChatColor.BLUE +"+ ∞ damage");
    40. kniveMeta.setLore(lore);
    41. //lore end
    42. //rename
    43. kniveMeta.setDisplayName(ChatColor.AQUA +"Throwing" +ChatColor.BLUE +" Knive");
    44. //rename ends
    45. //enchants
    46. kniveMeta.addEnchant(Enchantment.KNOCKBACK, 100, true);
    47. kniveMeta.addEnchant(Enchantment.LOOT_BONUS_MOBS, 100, true);
    48. kniveMeta.addEnchant(Enchantment.DAMAGE_ALL, 20, true);
    49. //enchants end
    50. knive.setItemMeta(kniveMeta);
    51. //Meta Data end
    52. //Recipe
    53. ShapedRecipe kniveRecipe = new ShapedRecipe(knive);
    54. kniveRecipe.shape("###","RIR","PSP");
    55. kniveRecipe.setIngredient('P', Material.POWERED_RAIL);
    56. kniveRecipe.setIngredient('R', Material.REDSTONE);
    57. kniveRecipe.setIngredient('I', Material.IRON_INGOT);
    58. kniveRecipe.setIngredient('S', Material.STICK);
    59. //Recipe End
    60. Bukkit.getServer().addRecipe(kniveRecipe);
    61. Bukkit.getServer().addRecipe(fireKniveRecipe);
    62.  
    63. }


    And here is my plugin.yml:
    Code:
    name: ThrowingKnives
    main: com.live.Peter_Higgs.Main
    version: 2.0.3
     
  20. Offline

    DatChiefGoonBac

    I has this problem, I have now found the plugin.yml shud have no capitals before the colons. Also the 'Main' should be me.Browning98.Facepalm.Facepalm



    HOPE THIS HELPS :D IF IT DOES PLS LET ME KNOW! I JUST LITERALLY NOW TRIED IT AND IT WORKED!!!
     
  21. Offline

    roadrunnerrr

    Thx! I had an issue with my own plugins not working. - roadrunnerrr
     
  22. Offline

    eyamaz

    Well, since I can't log in to H1Z1 at least I can still kill undead here...

    Thread locked 4 Necro
     
Thread Status:
Not open for further replies.

Share This Page