I'm a new plugin dev. I just exported for the first time, and here's the error I get. Something obvious, I assume? Code: 12:55:44 [SEVERE] Could not load 'plugins\Wisk.jar' in folder 'plugins' org.bukkit.plugin.InvalidPluginException: java.lang.NullPointerException at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j ava:148) at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager. java:287) at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager .java:211) at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:207) at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:537) at org.bukkit.Bukkit.reload(Bukkit.java:182) at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java: 22) at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:16 6) at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:4 69) at org.bukkit.craftbukkit.CraftServer.dispatchServerCommand(CraftServer. java:465) at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:599) at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:568) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:452) at net.minecraft.server.ThreadServerApplication.run(SourceFile:490) Caused by: java.lang.NullPointerException at org.bukkit.plugin.PluginLogger.<init>(PluginLogger.java:22) at org.bukkit.plugin.java.JavaPlugin.getLogger(JavaPlugin.java:359) at chris32.wisk.Wisk.<init>(Wisk.java:8) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou rce) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j ava:144) ... 13 more Please help! Thanks in advance.
Code: Logger log = this.getLogger(); That is an error It should be Logger log = this.getLogger("Minecraft");
Thanks so much! I didn't see that in the tutorial... Weird. Ah wait... now I have a new error in eclipse. This is the code: Code: Logger log = this.getLogger("Minecraft"); This is the error: Code: The method getLogger() in the type JavaPlugin is not applicable for the arguments (String) EDIT by Moderator: merged posts, please use the edit button instead of double posting.
No, it should not. this.getLogger() is perfectly valid, and gets you a custom logger which automatically pretends your plugin name to your log messages. The probable cause of the problem is that it's being called too early (your plugin backtrace suggests that you're calling it from your constructor) - as long as you call it from onEnable() you should be fine.
Chris32 The above answer is correct. I just wanted to reiterate it, since there is a lot of misinformation in this thread.