[Help] No classdeffound

Discussion in 'Plugin Development' started by Shalar, Jan 20, 2012.

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

    Shalar

    I am trying to make a plugin, that uses joda-time to calculate elapsed time. I have added it to my project as an external library, and when using the plugin i get an error saying that noclassdeffound. I have figured out that thiis means the library is not in my classpath. my question is this: How do I add this to my classpath, and do so in such a way that it can download the library if it does not exist, as well as not causing a conflict with other plugins?

    I have shaded it with maven and used maven to put it in the classpath but when i do so other plugins that don't (for all I can tell) even use joda complain that it cannot find the classpath for some part of joda.

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

    nisovin

    You should post the full error you're getting. My guess is your plugin.yml file is wrong.
     
  3. Offline

    ItsHarry

    zsombi28 likes this.
  4. Offline

    Shalar

    The problem after I do that is some other class tries looking for joda if it is found in the classpath. I have encountered this with ChestShop. The error thrown by ChestShop is below.

    Code:
    2012-01-21 05:26:46 [SEVERE] Error occurred while enabling ChestShop v3.33 (Is it up to date?): org/joda/time/LocalDateTime
    java.lang.NoClassDefFoundError: org/joda/time/LocalDateTime
        at com.avaje.ebeaninternal.server.type.DefaultTypeManager.initialiseJodaTypes(DefaultTypeManager.java:633)
        at com.avaje.ebeaninternal.server.type.DefaultTypeManager.<init>(DefaultTypeManager.java:165)
        at com.avaje.ebeaninternal.server.core.InternalConfiguration.<init>(InternalConfiguration.java:137)
        at com.avaje.ebeaninternal.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:209)
        at com.avaje.ebeaninternal.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:64)
        at com.avaje.ebean.EbeanServerFactory.create(EbeanServerFactory.java:78)
        at com.lennardf1989.bukkitex.Database.loadDatabase(Database.java:156)
        at com.lennardf1989.bukkitex.Database.initializeDatabase(Database.java:74)
        at com.Acrobot.ChestShop.ChestShop.setupDB(ChestShop.java:122)
        at com.Acrobot.ChestShop.ChestShop.onEnable(ChestShop.java:58)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:188)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:968)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:186)
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:169)
        at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:348)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:335)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:165)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:399)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:457)
    Caused by: java.lang.ClassNotFoundException: org.joda.time.LocalDateTime
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
     
  5. Offline

    zsombi28

  6. Offline

    ChrisixStudios

    Try putting the jar file of the library in your plugins folder. I know eclipse sets it up so I can do that maybe maven does to.
     
  7. Offline

    zsombi28

    I tryed, but no effect.
     
  8. Offline

    ChrisixStudios

    Then I wouldn't know, sorry
     
  9. Offline

    zsombi28

    Solved, when put to project lib, server lib, and copyed all files to plugin. Thanks for help
     
Thread Status:
Not open for further replies.

Share This Page