ClassNotFoundException

Discussion in 'Spigot Plugin Development' started by Bean900, May 25, 2017.

  1. Hello you,
    I get unfortunately always repeatedly the error
    ClassNotFoundException
    After a reboot it works mostly again but after one or two days I have the problem in another class. During this time, the server is rebooted at least once a day.
    My jars are built with Gradle. Any ideas?
    Thanks:)
     
  2. post your error.
     
  3. Code (Text):

    org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[craftbukkit.jar:git-Spigot-3fb9445-6e3cec8]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[craftbukkit.jar:git-Spigot-3fb9445-6e3cec8]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [craftbukkit.jar:git-Spigot-3fb9445-6e3cec8]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [craftbukkit.jar:git-Spigot-3fb9445-6e3cec8]
        at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.java:1849) [craftbukkit.jar:git-Spigot-3fb9445-6e3cec8]
        at net.minecraft.server.v1_11_R1.PacketPlayInWindowClick.a(SourceFile:33) [craftbukkit.jar:git-Spigot-3fb9445-6e3cec8]
        at net.minecraft.server.v1_11_R1.PacketPlayInWindowClick.a(SourceFile:10) [craftbukkit.jar:git-Spigot-3fb9445-6e3cec8]
        at net.minecraft.server.v1_11_R1.PlayerConnectionUtils$1.run(SourceFile:13) [craftbukkit.jar:git-Spigot-3fb9445-6e3cec8]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_101]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_101]
        at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:46) [craftbukkit.jar:git-Spigot-3fb9445-6e3cec8]
        at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:747) [craftbukkit.jar:git-Spigot-3fb9445-6e3cec8]
        at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:399) [craftbukkit.jar:git-Spigot-3fb9445-6e3cec8]
        at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:678) [craftbukkit.jar:git-Spigot-3fb9445-6e3cec8]
        at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:576) [craftbukkit.jar:git-Spigot-3fb9445-6e3cec8]
        at java.lang.Thread.run(Thread.java:745) [?:1.8.0_101]
    Caused by: java.lang.NoClassDefFoundError: de/thebohne/datenbank/ReportPrioObject
        at de.thebohne.befehle.Report.loadReportInventory(Report.java:461) ~[?:?]
        at de.thebohne.befehle.Report.lambda$chooseReport$2(Report.java:159) ~[?:?]
        at de.thebohne.inventory.CustomInventory.onInventoryClick(CustomInventory.java:68) ~[?:?]
        at de.thebohne.inventory.CustomInventoryManager.onInventoryClick(CustomInventoryManager.java:44) ~[?:?]
        at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_101]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_101]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[craftbukkit.jar:git-Spigot-3fb9445-6e3cec8]
        ... 15 more
    Caused by: java.lang.ClassNotFoundException: de.thebohne.datenbank.ReportPrioObject
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_101]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:101) ~[craftbukkit.jar:git-Spigot-3fb9445-6e3cec8]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[craftbukkit.jar:git-Spigot-3fb9445-6e3cec8]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_101]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_101]
        at de.thebohne.befehle.Report.loadReportInventory(Report.java:461) ~[?:?]
        at de.thebohne.befehle.Report.lambda$chooseReport$2(Report.java:159) ~[?:?]
        at de.thebohne.inventory.CustomInventory.onInventoryClick(CustomInventory.java:68) ~[?:?]
        at de.thebohne.inventory.CustomInventoryManager.onInventoryClick(CustomInventoryManager.java:44) ~[?:?]
        at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_101]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_101]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[craftbukkit.jar:git-Spigot-3fb9445-6e3cec8]
        ... 15 more
     
     
  4. There's more to the error, post the entire trace from top to bottom
     
  5. Seems like your plugin, can't locate the class "de.thebohne.datenbank.ReportPrioObject".

    I bought some sourcecode of some guy, but he unfortunately forgot to import like 50 classes for the commands in his main class. Does that ring a bell?

    Even though i'm still learning java myself, i'm always happy to help! :D
     
  6. Edit the post above
     
  7. My first thought was that the build of the jar is not running properly ... but then the problems should still be present after a reboot. But they are not.
     
  8. Jars are zip files, open it up. Is the class there?
     
  9. Unfortunately, I have already overwritten the jar. The next time i will take a look at it and post it here.