Error please help (eclipse) "First Plugin"

Discussion in 'Plugin Development' started by lucabunny77, Jun 1, 2014.

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

    lucabunny77

    Ok I opened EasyHub.jar (with win rar) And there are 4 folders in EasyHub.jar there is META-INf and plugin.yml and .project and .classpath
     
  2. lucabunny77 Does the plugin.yml match the one you were expecting? And how about the folders? Can you find the main class path at me > lucabunny77 > EasyHub > EasyHub.class?
     
  3. Offline

    lucabunny77

    Y
    yes same plugin.yml

    You might wanna see the full server log when I open it there's slot more to it that may help

    heres my server log! (when i put plugin in plugins folde rand try to run it)
    [11:57:07] [Server thread/INFO]: Starting minecraft server version 1.7.9
    [11:57:07] [Server thread/INFO]: Loading properties
    [11:57:08] [Server thread/INFO]: Default game type: SURVIVAL
    [11:57:08] [Server thread/INFO]: Generating keypair
    [11:57:08] [Server thread/INFO]: Starting Minecraft server on *:25565
    [11:57:09] [Server thread/INFO]: This server is running CraftBukkit version git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks (MC: 1.7.9) (Implementing API version 1.7.9-R0.2)
    [11:57:10] [Server thread/ERROR]: Could not load 'plugins\EasyHub.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: Cannot find main class `me.lucabunny77.EasyHub.EasyHub'
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:42) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:127) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:328) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.craftbukkit.v1_7_R3.CraftServer.loadPlugins(CraftServer.java:355) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.craftbukkit.v1_7_R3.CraftServer.<init>(CraftServer.java:317) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.PlayerList.<init>(PlayerList.java:68) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.DedicatedPlayerList.<init>(SourceFile:14) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.DedicatedServer.init(DedicatedServer.java:126) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:436) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    Caused by: java.lang.ClassNotFoundException: me.lucabunny77.EasyHub.EasyHub
    at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.8.0_05]
    at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.8.0_05]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_05]
    at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_05]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:77) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:62) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_05]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_05]
    at java.lang.Class.forName0(Native Method) ~[?:1.8.0_05]
    at java.lang.Class.forName(Unknown Source) ~[?:1.8.0_05]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:40) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    ... 10 more
    [11:57:10] [Server thread/WARN]: Failed to load white-list:
    net.minecraft.util.com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1
    at net.minecraft.util.com.google.gson.Gson.fromJson(Gson.java:815) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.util.com.google.gson.Gson.fromJson(Gson.java:768) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.JsonList.load(JsonList.java:148) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.DedicatedPlayerList.B(SourceFile:123) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.DedicatedPlayerList.<init>(SourceFile:30) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.DedicatedServer.init(DedicatedServer.java:126) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:436) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1
    at net.minecraft.util.com.google.gson.stream.JsonReader.beginArray(JsonReader.java:338) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.util.com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:79) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.util.com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:60) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.util.com.google.gson.Gson.fromJson(Gson.java:803) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    ... 7 more
    [11:57:10] [Server thread/INFO]: Preparing level "world"
    [11:57:10] [Thread-7/INFO]: ----- Bukkit Auto Updater -----
    [11:57:10] [Thread-7/INFO]: It appears that you're running a Beta Build, when you've specified in bukkit.yml that you prefer to run Recommended Builds.
    [11:57:10] [Thread-7/INFO]: If you would like to be kept informed about new Beta Build releases, it is recommended that you change 'preferred-channel' in your bukkit.yml to 'beta'.
    [11:57:10] [Thread-7/INFO]: With that set, you will be told whenever a new version is available for download, so that you can always keep up to date and secure with the latest fixes.
    [11:57:10] [Thread-7/INFO]: If you would like to disable this warning, simply set 'suggest-channels' to false in bukkit.yml.
    [11:57:10] [Thread-7/INFO]: ----- ------------------- -----
    [11:57:11] [Server thread/INFO]: Preparing start region for level 0 (Seed: 3716290262202286456)
    [11:57:12] [Server thread/INFO]: Preparing spawn area: 3%
    [11:57:13] [Server thread/INFO]: Preparing spawn area: 13%
    [11:57:14] [Server thread/INFO]: Preparing spawn area: 16%
    [11:57:15] [Server thread/INFO]: Preparing spawn area: 24%
    [11:57:16] [Server thread/INFO]: Preparing spawn area: 30%
    [11:57:17] [Server thread/INFO]: Preparing spawn area: 42%
    [11:57:21] [Server thread/INFO]: Preparing spawn area: 49%
    [11:57:22] [Server thread/INFO]: Preparing spawn area: 61%
    [11:57:23] [Server thread/INFO]: Preparing spawn area: 65%
    [11:57:25] [Server thread/INFO]: Preparing spawn area: 67%
    [11:57:26] [Server thread/INFO]: Preparing spawn area: 83%
    [11:57:27] [Server thread/INFO]: Preparing spawn area: 97%
    [11:57:27] [Server thread/INFO]: Preparing start region for level 1 (Seed: 1574762139599013811)
    [11:57:28] [Server thread/INFO]: Preparing spawn area: 49%
    [11:57:29] [Server thread/INFO]: Preparing spawn area: 86%
    [11:57:29] [Server thread/INFO]: Preparing start region for level 2 (Seed: 1574762139599013811)
    [11:57:30] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
    [11:57:30] [Server thread/INFO]: Done (19.733s)! For help, type "help" or "?"

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

    Necrodoom

    Oh god, this thread a train wreck.
    lucabunny77 delete your 2 latest posts. There is no reason to paste the exact same log 3 times.
    Next, go to your project file, go to the main class location, and copy past the full path.
    If you cannot do this, then you do not have enough knowledge of how to make a project in order to make plugins.
     
    AoH_Ruthless likes this.
  5. Offline

    lucabunny77

    The reason I posted 3 times is because each post was to a different person
     
  6. Offline

    Necrodoom

    The tahg button exists for this.
     
    AoH_Ruthless likes this.
  7. Offline

    lucabunny77

    Oh
     
  8. Offline

    Necrodoom

    Again:
     
  9. Offline

    lucabunny77

    Ok gone. But how to I fix the error!?
     
  10. Offline

    Necrodoom

     
  11. Offline

    lucabunny77

    Ok found my class so whAt do I do right click it and copy or somthing?
    Necrodoom

    Ok I found the class now what?

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

    Necrodoom

     
    AdamQpzm likes this.
  13. Offline

    lucabunny77

    II watched a video of his guy making a plugin followed is exact steps so there's nothing I've done wrong?
     
  14. lucabunny77 Ah, the difference between knowledge and following instructions.
     
    dsouzamatt likes this.
  15. Offline

    lucabunny77

    How do I take screenshots in eclipse
     
  16. lucabunny77 Same way as you'd take a screenshot of anything. Commonly with the print screen button.
     
  17. Offline

    lucabunny77



    Oh thx and the other day when I had the error before I think I was looking for stuff then I was in this setting and it had main class: but then nothing after that want me to take pic if I can find?
     
  18. Offline

    es359

    Ok... I really think you need to go back to the basics and read the plugin tutorial.

    http://wiki.bukkit.org/Plugin_Tutorial

    lucabunny77

    @lucabunny77
    Alright, this is what your package should look like. For now, ignore the all the other classes EXCEPT for main.
    Notice the placement of the plugin.yml.

    [​IMG]

    Here is my plugin.yml.
    In the main: section, notice how I have my package. In order for the plugin to find your main class (Your main class is any class that has the onEnable() method.) You must have the correct path.
    In this plugin my original package is: me.es359.ServerControl
    Since the class we want the plugin to find is called 'Main' (You could call it whatever you want).
    My package needs to be me.es359.ServerControl.<MainClass> or in my case: me.es359.ServerControl.Main
    Which is what you see in the screenshot of the plugin.yml below.

    [​IMG]

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

    lucabunny77

    Do you think I should just restart everything?

    Ok you know what I'm gonna. Restart everything

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

    es359

    Some times it is best. It took me almost a year to really understand how to do this lol, so don't feel bad about it
     
  21. Offline

    lucabunny77

    Yea I watched a diffrent tutorial this time (a guy suggested it aswell) cus I watched this guys tut before but I gave up because the java doc xD but this time my plugin works it's not a hub plugin it's a hello plugin very basic so when you type /hello it says: hello {Player}
     
    es359 likes this.
  22. Offline

    Shlobdon

    You watched the video I suggested, eh? When I first started I followed that video. I'm a trial and error person so I just started messing around with the current code I had and made it do different things. Just mess around with the /hello plugin and add different commands and such. That guy has other videos as well. I think he's got around 10 now? The videos teach you how to do different things with Bukkit plugins. Now that you've created your first VERY basic plugin, I'd suggest going learning Java. At least the basics. :)
     
  23. Offline

    lucabunny77

    Thx um he only has 8 vids :( after I watch and make all his other tut plugins I wanna make my own like a mcstrike plugin don't know mcstrike it's like a fps (first person shooter) server and it's amazing I want to make mine like that [removed*] so do I have to learn java to make my own.? :)

    [*edit by JaguarJo: removed advertising]
     
  24. Offline

    Shlobdon

    lucabunny77 .... Yes. You'll really need to learn Java, if not you will not know how to do a single thing.
     
  25. Offline

    AoH_Ruthless

    lucabunny77
    Plugins like that have thousands upon thousands of lines of code. Minigames are some of the most extensive plugins out there and you need to know a lot of Java to be able to make an efficient and fun minigame. The basics will not be sufficient in most cases for very large plugins.
     
    es359 likes this.
Thread Status:
Not open for further replies.

Share This Page