Unexpected NoClassDefFoundError

Discussion in 'Plugin Development' started by RcExtract, Sep 25, 2018.

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

    RcExtract

    My plugin is loaded with no error stack trace printed. When my plugin is enabling, i call a method in a class declared in my plugin, which then a NoClassDefFoundError occurs. (The class does not exist?) but the class is confirmed to be in the jar file. Any ideas?
     
  2. Offline

    Reflxction

    Can you provide all the stacktrace? My only assumption is that you're using an external plugin jar and bukkit can't find this jar in your plugins folder. If you're using a dependency (not a plugin) and using maven (you really should if you don't already) add the following line to your dependency block in pom.xml:

    <scope>compile</scope>

    Sent from my TRT-L21A using Tapatalk
     
  3. Offline

    RcExtract

    Did u read? The class comes within my jar confirmed

    Sorry i cannot give you the exact stack trace but i can tell u the details. During enabling plugins period, the class def not found error was thrown on a method call attempt in my onEnable, and the stack trace shows the cause is classnotfoundexception, from pluginclassloader.loadClass

    A very simple but unreasonable no class def found error. Also, why is NoClassDefFoundError thrown upon method call attempt instead of loading mu plugin main class? (yeah the stack trace shows that)

    EDIT: kinda solved. First consequence of closing the class loader.
     
    Last edited: Sep 25, 2018
  4. Offline

    Reflxction

    Sorry I read it in a hurry. I assume it's an issue with bukkit loading your plugin and possibly a restart would solve it?

    Sent from my TRT-L21A using Tapatalk
     
  5. Offline

    RcExtract

    Sigh
     
Thread Status:
Not open for further replies.

Share This Page