Solved NoClassDefFoundError/NoClassFoundError

Discussion in 'Plugin Development' started by Geeky121, May 2, 2014.

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

    Geeky121

    Code:
    java.lang.NoClassDefFoundError: javax/mail/internet/AddressException
            at net.otwg.core.Core.onEnable(Core.java:61) ~[?:?]
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:250) ~[s
    pigot.jar:git-Spigot-1407]
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader
    .java:324) [spigot.jar:git-Spigot-1407]
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
    r.java:405) [spigot.jar:git-Spigot-1407]
            at org.bukkit.craftbukkit.v1_7_R3.CraftServer.loadPlugin(CraftServer.jav
    a:462) [spigot.jar:git-Spigot-1407]
            at org.bukkit.craftbukkit.v1_7_R3.CraftServer.enablePlugins(CraftServer.
    java:380) [spigot.jar:git-Spigot-1407]
            at net.minecraft.server.v1_7_R3.MinecraftServer.n(MinecraftServer.java:3
    59) [spigot.jar:git-Spigot-1407]
            at net.minecraft.server.v1_7_R3.MinecraftServer.g(MinecraftServer.java:3
    33) [spigot.jar:git-Spigot-1407]
            at net.minecraft.server.v1_7_R3.MinecraftServer.a(MinecraftServer.java:2
    89) [spigot.jar:git-Spigot-1407]
            at net.minecraft.server.v1_7_R3.DedicatedServer.init(DedicatedServer.jav
    a:193) [spigot.jar:git-Spigot-1407]
            at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java
    :450) [spigot.jar:git-Spigot-1407]
            at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:6
    28) [spigot.jar:git-Spigot-1407]
    Caused by: java.lang.ClassNotFoundException: javax.mail.internet.AddressExceptio
    n
            at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.7.0_25]
            at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.7.0_25]
            at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_
    25]
            at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.7.0_25]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:77) ~[spigot.jar:git-Spigot-1407]
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:62) ~[spigot.jar:git-Spigot-1407]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_25]
            at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_25]
            ... 12 more
    I keep getting this error while trying to run my plugin with the javax.mail.jar. I know the issue but I am not positive on how to fix it. What I need to do is somehow export javax.mail.jar with the plugin so when my plugin can find and use the file. How should I go about fixing this?

    P.S.-My goal is to be able to send an email from the server to my inbox.
     
  2. Offline

    RawCode

    [spigot.jar:git-Spigot-1407]

    try using valid software first.
     
    xTigerRebornx likes this.
  3. Offline

    Mr360zack

    spigot ain't supported here.

    and I'm seeing this error more and more often, try making sure you are running the same jar on your server that you are compiling with.
     
  4. Offline

    Geeky121

    Yea, sorry about that. After awhile you sorta forget you switched to spigot. and thanks for the suggestion!
     
  5. Offline

    Cirno

    While I may agree that OP isn't using the right software to be asking help for, the javax package is not included in either CraftBukkit or Spigot.

    Anyways, to OP:
    You need to add the javax.mail.jar to your classpath when you start the server up.
     
  6. Offline

    RawCode

    this wont fix issue in case of plugin distribution, adding URL to classpach at runtime is not very easy action. Cirno
     
  7. Offline

    TnT

    Locked. Seek support on the forums for the software you use. This is not a generic java development forum.
     
Thread Status:
Not open for further replies.

Share This Page