[SOLVED] Class Not Found Exception??

Discussion in 'Plugin Development' started by LandonTheGeek, Jul 5, 2012.

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

    LandonTheGeek

    Someone please help! I am getting a class not found exception on my terminal after making my plugin! I am so nervous and don't wanna have to delete my plugin!
    ~Beast
     
  2. Offline

    Firefly

    Code/stacktrace would help.
     
  3. Offline

    hawkfalcon

    Please post your code and the error!
    Edit: ._. Firefly beat me to it by less than a second.
     
  4. Offline

    LandonTheGeek

    Code:
    com.xXTh3B3astXxify.TNTNotifier
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:151)
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:305)
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:230)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:213)
        at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:189)
        at net.minecraft.server.ServerConfigurationManager.<init>(ServerConfigurationManager.java:53)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:166)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:432)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:492)
    Caused by: java.lang.ClassNotFoundException: com.xXTh3B3astXxify.TNTNotifier
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:41)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:29)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:140)
        ... 8 more
     
  5. Offline

    Firefly

    I'm going to take a guess and say that your plugin.yml doesn't point to the correct package/class of your main class in your plugin.
     
  6. Offline

    LandonTheGeek

    So that means i need to put a main: CORRECTCLASSNAME
    in there?

    You mean to put in the class or the package?

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

    Firefly

    If I remember correctly, you need to put you.package.name.YourMainClass there. I may be wrong.
     
  8. Offline

    LandonTheGeek

    I'll try it.... Stay with me! :)

    Nope... Didn't work.... Heres the main: com.xXTh3B3astXxify.TNTNotifier.TNTNotifer

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

    Firefly

    Same error?
     
  10. Offline

    LandonTheGeek

    Yes..... The first class with the onEnable onDisable thing should be my main class? I have another that has my listener and tells the log you know that the player placed it. I'm also following a video from i believe 1.2.5 so it should work!
     
  11. Offline

    Firefly

    The class that extends JavaPlugin is your main class.
     
  12. Offline

    ItsHarry

    Paste entire plugin.yml
     
  13. Offline

    LandonTheGeek

    You are correct.... That reminds me... When stating it in the plugin.yml do i need to put the .java at the end?

    Code:
    name: TNTNotifier
    version: 0.1
    main: com.xXTh3B3astXxify.TNTNotifier.TNTNotifer

    My first plugin by the way. :)

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

    ItsHarry

    Paste source code
     
  15. Offline

    LandonTheGeek

    Solved!!!!!! My spelling was wrong! Also you helped me a ton FireFly!
    SOLVED
     
  16. Offline

    ItsHarry

    k that's why I asked you to paste the source code.
     
    McLuke500 likes this.
Thread Status:
Not open for further replies.

Share This Page