games647 / LagMonitor

Monitor performance of your Minecraft server. Similar to VisualVM and Java Mission Control.
https://dev.bukkit.org/bukkit-plugins/lagmonitor/
MIT License
190 stars 24 forks source link

Not working with MySQL database #122

Closed joex92 closed 3 years ago

joex92 commented 3 years ago
[06:38:35 INFO]: [LagMonitor] Enabling LagMonitor v1.17*
[06:38:35 INFO]: [LagMonitor] Found JNA native library. Enabling extended native data support to display more data
[06:38:35 INFO]: [com.sun.jna.Native] Looking in classpath from jdk.internal.loader.ClassLoaders$AppClassLoader@55054057 for /com/sun/jna/linux-x86-64/libjnidispatch.so
[06:38:35 INFO]: [com.sun.jna.Native] Found library resource at jar:file:/home/container/cache/patched_1.16.5.jar!/com/sun/jna/linux-x86-64/libjnidispatch.so
[06:38:35 INFO]: [com.sun.jna.Native] Extracting library to /home/container/?/.cache/JNA/temp/jna1362152471024046370.tmp
[06:38:35 INFO]: [com.sun.jna.Native] Trying /home/container/?/.cache/JNA/temp/jna1362152471024046370.tmp
[06:38:35 INFO]: [com.sun.jna.Native] Found jnidispatch at /home/container/?/.cache/JNA/temp/jna1362152471024046370.tmp
[06:38:35 ERROR]: Error occurred while enabling LagMonitor v1.17 (Is it up to date?)
java.lang.NoClassDefFoundError: com/mysql/jdbc/jdbc2/optional/MysqlDataSource
        at com.github.games647.lagmonitor.storage.Storage.<init>(Storage.java:38) ~[?:?]
        at com.github.games647.lagmonitor.LagMonitor.setupMonitoringDatabase(LagMonitor.java:181) ~[?:?]
        at com.github.games647.lagmonitor.LagMonitor.onEnable(LagMonitor.java:127) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.5.jar:git-Airplane-4]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.16.5.jar:git-Airplane-4]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.16.5.jar:git-Airplane-4]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:518) ~[patched_1.16.5.jar:git-Airplane-4]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:432) ~[patched_1.16.5.jar:git-Airplane-4]
        at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:596) ~[patched_1.16.5.jar:git-Airplane-4]
        at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:311) ~[patched_1.16.5.jar:git-Airplane-4]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1074) ~[patched_1.16.5.jar:git-Airplane-4]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:293) ~[patched_1.16.5.jar:git-Airplane-4]
        at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:153) ~[patched_1.16.5.jar:git-Airplane-4]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:114) ~[patched_1.16.5.jar:git-Airplane-4]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[?:?]
        ... 13 more
[06:38:35 INFO]: [LagMonitor] Disabling LagMonitor v1.17
[06:38:35 ERROR]: Error occurred while disabling LagMonitor v1.17 (Is it up to date?)
java.lang.IllegalArgumentException: Cannot find field with type interface java.lang.Runnable
        at com.github.games647.lagmonitor.traffic.Reflection.getField(Reflection.java:184) ~[?:?]
        at com.github.games647.lagmonitor.traffic.Reflection.getField(Reflection.java:181) ~[?:?]
        at com.github.games647.lagmonitor.traffic.Reflection.getField(Reflection.java:103) ~[?:?]
        at com.github.games647.lagmonitor.inject.TaskInjector.restore(TaskInjector.java:62) ~[?:?]
        at com.github.games647.lagmonitor.LagMonitor.onDisable(LagMonitor.java:224) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:265) ~[patched_1.16.5.jar:git-Airplane-4]
        at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:405) ~[patched_1.16.5.jar:git-Airplane-4]
        at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:533) ~[patched_1.16.5.jar:git-Airplane-4]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:374) ~[patched_1.16.5.jar:git-Airplane-4]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.16.5.jar:git-Airplane-4]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:518) ~[patched_1.16.5.jar:git-Airplane-4]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:432) ~[patched_1.16.5.jar:git-Airplane-4]
        at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:596) ~[patched_1.16.5.jar:git-Airplane-4]
        at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:311) ~[patched_1.16.5.jar:git-Airplane-4]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1074) ~[patched_1.16.5.jar:git-Airplane-4]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:293) ~[patched_1.16.5.jar:git-Airplane-4]
        at java.lang.Thread.run(Thread.java:834) [?:?]
games647 commented 3 years ago

Please follow the issue template. It's important to fix the issue. For example in this case it's relevant which server software you are using.

games647 commented 3 years ago

Please try out a dev build for the last error. That was fixed, but not yet released on SpigotMC or other platforms.

joex92 commented 3 years ago

tried latest dev build and now is loading properly :+1:

joex92 commented 3 years ago

using paper purpur 1.16.5 fork on a gameserver hosting btw... forgot to add this...

games647 commented 3 years ago

Ok then I wonder what the issue was with loading the MySQL driver, but maybe that was fixed in the meanwhile with the newer LagMonitor version.

joex92 commented 3 years ago

ok, the plugin is loading correctly now, but it seem to be failing when trying to connect to the database:

[08:58:30 INFO]: [LagMonitor] Enabling LagMonitor v1.17.2-SNAPSHOT-d87c089
[08:58:30 ERROR]: Error occurred while enabling LagMonitor v1.17.2-SNAPSHOT-d87c089 (Is it up to date?)
java.lang.NoClassDefFoundError: com/mysql/jdbc/jdbc2/optional/MysqlDataSource
        at com.github.games647.lagmonitor.storage.Storage.<init>(Storage.java:39) ~[?:?]
        at com.github.games647.lagmonitor.LagMonitor.setupMonitoringDatabase(LagMonitor.java:147) ~[?:?]
        at com.github.games647.lagmonitor.LagMonitor.onEnable(LagMonitor.java:123) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.5.jar:git-Airplane-4]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.16.5.jar:git-Airplane-4]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.16.5.jar:git-Airplane-4]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:518) ~[patched_1.16.5.jar:git-Airplane-4]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:432) ~[patched_1.16.5.jar:git-Airplane-4]
        at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:596) ~[patched_1.16.5.jar:git-Airplane-4]
        at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:311) ~[patched_1.16.5.jar:git-Airplane-4]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1074) ~[patched_1.16.5.jar:git-Airplane-4]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:293) ~[patched_1.16.5.jar:git-Airplane-4]
        at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:153) ~[patched_1.16.5.jar:git-Airplane-4]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:114) ~[patched_1.16.5.jar:git-Airplane-4]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:522) ~[?:?]
        ... 13 more
[08:58:30 INFO]: [LagMonitor] Disabling LagMonitor v1.17.2-SNAPSHOT-d87c089

the server was on a different gameserver hosting, recently it had to be moved because of prices. In the previous hosting the plugin could succesfully connect to the database (using an Alwaysdata.net Database) but after changing hosting, it's failing... I would suggest to make the plugin to disable the use of the database option instead of disabling itself, and show a message to the OP users who log in...

games647 commented 3 years ago

Okay, I found the source. The driver was updated. The plugin disables itself is a behavior made by the Paper server implementation. In Java errors with the name *Error instead of *Exception are more severe and meant to crash instead of catching the error.

I pushed a change that should fix it.

joex92 commented 3 years ago

yes! that fixed it, thanks :+1: