Reputation: 91
First of all I'm beginner and I'm not the author of the plugin I'm working on (also I don't speak English well). If I'm not specific enough, tell me.
This plugin was running in the 1.12 version of minecraft properly. My goal is to update it for the 1.13 version. I've already fix all issues Gradle showed. Now I want to test but here I'm stuck.
I'm getting this error when I try to load the plugin:
[18:31:21] [Server thread/ERROR]: Could not load 'plugins/mainplugin-3.3.15-SNAPSHOT.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: org/hibernate/service/ServiceRegistry
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:133) ~[patched_1.13.2.jar:git-Paper-405]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[patched_1.13.2.jar:git-Paper-405]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) ~[patched_1.13.2.jar:git-Paper-405]
at org.bukkit.craftbukkit.v1_13_R2.CraftServer.loadPlugins(CraftServer.java:326) ~[patched_1.13.2.jar:git-Paper-405]
at org.bukkit.craftbukkit.v1_13_R2.CraftServer.reload(CraftServer.java:851) ~[patched_1.13.2.jar:git-Paper-405]
at org.bukkit.Bukkit.reload(Bukkit.java:603) ~[patched_1.13.2.jar:git-Paper-405]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:55) ~[patched_1.13.2.jar:git-Paper-405]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:151) ~[patched_1.13.2.jar:git-Paper-405]
at org.bukkit.craftbukkit.v1_13_R2.CraftServer.dispatchCommand(CraftServer.java:729) ~[patched_1.13.2.jar:git-Paper-405]
at org.bukkit.craftbukkit.v1_13_R2.CraftServer.dispatchServerCommand(CraftServer.java:691) ~[patched_1.13.2.jar:git-Paper-405]
at net.minecraft.server.v1_13_R2.DedicatedServer.aU(DedicatedServer.java:483) ~[patched_1.13.2.jar:git-Paper-405]
at net.minecraft.server.v1_13_R2.DedicatedServer.b(DedicatedServer.java:440) ~[patched_1.13.2.jar:git-Paper-405]
at net.minecraft.server.v1_13_R2.MinecraftServer.a(MinecraftServer.java:943) ~[patched_1.13.2.jar:git-Paper-405]
at net.minecraft.server.v1_13_R2.MinecraftServer.run(MinecraftServer.java:841) ~[patched_1.13.2.jar:git-Paper-405]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
Caused by: java.lang.NoClassDefFoundError: org/hibernate/service/ServiceRegistry
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_131]
at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_131]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:82) ~[patched_1.13.2.jar:git-Paper-405]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:129) ~[patched_1.13.2.jar:git-Paper-405]
... 14 more
Caused by: java.lang.ClassNotFoundException: org.hibernate.service.ServiceRegistry
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_131]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:158) ~[patched_1.13.2.jar:git-Paper-405]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:104) ~[patched_1.13.2.jar:git-Paper-405]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_131]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_131]
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_131]
at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_131]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:82) ~[patched_1.13.2.jar:git-Paper-405]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:129) ~[patched_1.13.2.jar:git-Paper-405]
... 14 more
Dependencies are managed by Gradle using Artifactory. This plugin use a database and ORM. The minecraft server is running on a Debian server. The used API for the minecraft server is paperspigot. My IDE is Eclipse.
Upvotes: 2
Views: 573
Reputation: 50
You have to compile the artifacts your'e using in your jar file. In Gradle you could use the UberJar.
For example:
task customFatJar(type: Jar) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
Then you can build the jarfile using this task.
Upvotes: 0