I need help with ClassNotFoundException

Discussion in 'Plugin Development' started by xupwup, Jan 15, 2011.

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

    xupwup

    When I try to load my plugin with craftbukkit, I get the following errors:

    Code:
    SEVERE: Could not load plugins/LightVote.jar in plugins: null
    org.bukkit.plugin.InvalidPluginException
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:82)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:115)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:80)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:37)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:153)
            at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:140)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:104)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:177)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    Caused by: java.lang.ClassNotFoundException: com.bukkit.XUPWUP.LightVote
            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:31)
            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:76)
            ... 8 more
    
    This is my plugin.yml:
    Code:
    name: LightVote
    main: com.bukkit.XUPWUP.LightVote
    version: 1.5
    And if I open the jar with an archive manager I get the following file structure:
    Code:
    META-INF
     - MANIFEST.MF
    com
    - bukkit
    - - XUPWUP
    - - - LightVote
    - - - - some subclasses
    - - - - LightVote.class
    plugin.yml
    
    How do I fix this?
     
  2. Offline

    Huey

  3. Offline

    xupwup

    Not in my case. Also, it is a ClassNotFoundException, so if it would be an invalid class, it would say something else right?

    changing plugin.yml to
    Code:
    name: LightVote
    main: com.bukkit.XUPWUP.LightVote.LightVote
    version: 1.5
    fixed the problem

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jan 8, 2016
Thread Status:
Not open for further replies.

Share This Page