Weird console output

Discussion in 'Plugin Development' started by PixBenchMC, Oct 12, 2014.

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

    PixBenchMC

    I am making a OITQ plugin now and I wanted to test the plugin. And I got this console output:

    [14:57:55 ERROR]: Could not load 'plugins\OTIQ.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: Abnormal plugin type
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.jav
    a:56) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.2-11-g3fd9db2-b3098jnks]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:127) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.2-11-g3fd9db2-b3098jnks]
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:328) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.2-11-g3fd9db2-b3098jnks]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:251) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-11-g3fd9db2-b3098jnks]
    at org.bukkit.craftbukkit.v1_7_R3.CraftServer.loadPlugins(CraftServer.ja
    va:364) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-11-g3fd9db2-b3098jnks]
    at org.bukkit.craftbukkit.v1_7_R3.CraftServer.<init>(CraftServer.java:32
    6) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-11-g3fd9db2-b3098jnks]
    at net.minecraft.server.v1_7_R3.PlayerList.<init>(PlayerList.java:68) [c
    raftbukkit.jar:git-Bukkit-1.7.9-R0.2-11-g3fd9db2-b3098jnks]
    at net.minecraft.server.v1_7_R3.DedicatedPlayerList.<init>(SourceFile:14
    ) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-11-g3fd9db2-b3098jnks]
    at net.minecraft.server.v1_7_R3.DedicatedServer.init(DedicatedServer.jav
    a:126) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-11-g3fd9db2-b3098jnks]
    at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java
    :436) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-11-g3fd9db2-b3098jnks]
    at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:6
    28) [craftbukkit.jar:git-Bukkit-1.7.9-R0.2-11-g3fd9db2-b3098jnks]
    Caused by: java.lang.InstantiationException: NormalCraft.NormalCraftDevs.Develop
    er.PixBenchMC.Plugins.OTIQ.Core
    at java.lang.Class.newInstance(Unknown Source) ~[?:1.7.0_67]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.jav
    a:52) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.2-11-g3fd9db2-b3098jnks]
    ... 10 more

    If I need to post my Core class, tell me.
     
  2. PixBenchMC Yes, please post your full Core class (and maybe your plugin.yml too, just in case)
     
  3. Offline

    PixBenchMC

    Here is my class:
    Code:java
    1. package NormalCraft.NormalCraftDevs.Developer.PixBenchMC.Plugins.OTIQ;
    2.  
    3. import com.sk89q.worldedit.bukkit.selections.Selection;
    4. import org.bukkit.ChatColor;
    5. import org.bukkit.Location;
    6. import org.bukkit.command.Command;
    7. import org.bukkit.command.CommandSender;
    8. import org.bukkit.entity.Player;
    9. import org.bukkit.event.Listener;
    10. import org.bukkit.plugin.PluginDescriptionFile;
    11. import org.bukkit.plugin.java.JavaPlugin;
    12.  
    13.  
    14. /**
    15. * This bukkit plugin has been created by PixBenchMC and
    16. * NormalCraftDevelopers don't want anybody to use this plugin
    17. * and our source code. If you are trying to violate the licence
    18. * we are going to report your account on github.com. Thanks for reading!
    19. */
    20. public class Core extends JavaPlugin implements Listener {
    21.  
    22. public Selection selection;
    23.  
    24. public Core(String arenas) {
    25.  
    26. }
    27.  
    28. public static Core getArena() {
    29. return arena;
    30. }
    31.  
    32. public static void setArena(Core arena) {
    33. Core.arena = arena;
    34. }
    35.  
    36. private static Core arena = new Core("arenas");
    37.  
    38.  
    39. @Override
    40. public void onEnable() {
    41.  
    42. PluginDescriptionFile pluginDescriptionFile = getDescription();
    43. getLogger().info(pluginDescriptionFile.getVersion() + " is now enabled.");
    44. getServer().getPluginManager().registerEvents(this, this);
    45. }
    46.  
    47. @Override
    48. public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) {
    49. if (command.getName().equalsIgnoreCase("otiq")) {
    50. if (args.length == 0) {
    51. if (!(sender instanceof Player)) {
    52. sender.sendMessage("You cannot use that command because you are not a player.");
    53. } else {
    54.  
    55. sender.sendMessage(ChatColor.GOLD + "§l>> §9§l OTIQ Plugin Help §6§l <<");
    56. sender.sendMessage(ChatColor.GOLD + "§l>> §9§l /otiq reload - Reloads the plugin.");
    57. sender.sendMessage(ChatColor.GOLD + "§l>> §9§l /otiq create - Creates an arena in a region which is selected with WorldEdit");
    58. sender.sendMessage(ChatColor.GOLD + "§l>> §9§l /otiq start <ArenaNumber> - Starts the specified arena");
    59. sender.sendMessage(ChatColor.GOLD + "§l>> §9§l /otiq stop <ArenaNumber> - Stops a specified arena");
    60. sender.sendMessage(ChatColor.GOLD + "§l>> §9§l /otiq loc <ArenaNumber> - Sets the spawn location in the specified arena");
    61. sender.sendMessage("");
    62. sender.sendMessage("");
    63. sender.sendMessage("");
    64. sender.sendMessage(ChatColor.GOLD + "§l>> §9§l Plugin by PixBenchMC");
    65. }
    66.  
    67. } else if (args.length == 1) {
    68. if (args[0].equalsIgnoreCase("reload")) {
    69. this.getServer().getPluginManager().disablePlugin(this);
    70. getServer().getPluginManager().enablePlugin(this);
    71. sender.sendMessage(ChatColor.GREEN + "Plugin reloaded");
    72.  
    73. } else if (args[0].equalsIgnoreCase("create")) {
    74. if (selection == null) {
    75. sender.sendMessage(ChatColor.RED + "Please select a region for the arena!");
    76.  
    77. } else {
    78. if (selection.getHeight() > 100) {
    79. sender.sendMessage(ChatColor.RED + "Your area that you have selected is too big. Please make sure that your arena is smaller!");
    80. } else {
    81.  
    82. sender.sendMessage(ChatColor.GREEN + "Your arena is now selected. Please set the spawn location");
    83. if (args[0].equalsIgnoreCase("loc")) {
    84. Player player = (Player) sender;
    85. Location location = player.getLocation();
    86. }
    87. }
    88. }
    89. }
    90. }
    91. }
    92. return false;
    93.  
    94. }
    95.  
    96.  
    97.  
    98.  
    99. @Override
    100. public void onDisable() {
    101. PluginDescriptionFile pluginDescriptionFile = getDescription();
    102. getLogger().info(pluginDescriptionFile.getVersion() + " is now disabled.");
    103.  
    104. }
    105.  
    106. }


    And my plugin.yml:
    Code:
    name: OTIQ
    main: NormalCraft.NormalCraftDevs.Developer.PixBenchMC.Plugins.OTIQ.Core
    version: 1.0.1
    author: PixBenchMC
    description: OTIQ plugin
    commands:
      otiq:
        description: General plugin help.
        aliases: [oneinthequiver] 
    AdamQpzm I also used WorldEdit for selections. :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 14, 2016
  4. PixBenchMC I didn't look at the whole code so I don't know if there are any more errors, but your constructor is causing this problem. When Bukkit tries to load your plugin, it's being told it has to provide a String. It has no idea what String to give, so it just gives up and throws the exception you're seeing. :)

    Personally I'd just remove lines 24-26 since you don't even do anything with the constructor anyway.
     
  5. Offline

    PixBenchMC

    AdamQpzm It now works. Thanks a lot.
     
    AdamQpzm likes this.
Thread Status:
Not open for further replies.

Share This Page