Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassNotFoundException: com.mysql.jdbc.jdbc2.optional.MysqlDataSource #87

Closed
resi23 opened this issue Apr 12, 2021 · 5 comments
Closed

Comments

@resi23
Copy link

resi23 commented Apr 12, 2021

Hi, you should take a look at the new commit to papermc main branch from yesterday!

PaperMC/Paper#5473
PaperMC/Paper#5474

Its some changes to mysql.

[00:32:24] [Craft Scheduler Thread - 1/WARN]: [GameBox] Plugin GameBox v3.3.0 generated an exception while executing task 274
java.lang.RuntimeException: java.lang.ClassNotFoundException: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
at me.nikl.gamebox.common.zaxxer.hikari.util.UtilityElf.createInstance(UtilityElf.java:113) ~[?:?]
at me.nikl.gamebox.common.zaxxer.hikari.pool.PoolBase.initializeDataSource(PoolBase.java:316) ~[?:?]
at me.nikl.gamebox.common.zaxxer.hikari.pool.PoolBase.(PoolBase.java:109) ~[?:?]
at me.nikl.gamebox.common.zaxxer.hikari.pool.HikariPool.(HikariPool.java:108) ~[?:?]
at me.nikl.gamebox.common.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[?:?]
at me.nikl.gamebox.data.database.MysqlDB.load(MysqlDB.java:74) ~[?:?]
at me.nikl.gamebox.GameBox.setUpMySQL(GameBox.java:274) ~[?:?]
at me.nikl.gamebox.GameBox.loadDatabase(GameBox.java:248) ~[?:?]
at me.nikl.gamebox.GameBox.access$1000(GameBox.java:50) ~[?:?]
at me.nikl.gamebox.GameBox$2.run(GameBox.java:228) ~[?:?]
at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:100) ~[patched_1.16.5.jar:git-Paper-588]
at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) ~[patched_1.16.5.jar:git-Paper-588]
at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.16.5.jar:git-Paper-588]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) ~[?:?]
at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.jdbc2.optional.MysqlDataSource
at java.net.URLClassLoader.findClass(Unknown Source) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:182) ~[patched_1.16.5.jar:git-Paper-588]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:111) ~[patched_1.16.5.jar:git-Paper-588]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:?]
at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:?]
at me.nikl.gamebox.common.zaxxer.hikari.util.UtilityElf.createInstance(UtilityElf.java:100) ~[?:?]
... 15 more

@Sandukhan
Copy link

Ya since the 588 update a bunch of plugins that were using the older "com.mysql.jdbc.Driver" on my server had problems connecting to mysql.

Also makes it any difference using mariadb-server and client/connector instead of the mysql stuff?
So far i was running with mariadb just fine.

@resi23
Copy link
Author

resi23 commented Apr 12, 2021

on my server run 10.4.12-MariaDB-1:10.4.12+maria~bionic

@resi23
Copy link
Author

resi23 commented Apr 13, 2021

My Solution:

me.nikl.gamebox.data.database.MysqlDB

change row 67 from

hikari.setDataSourceClassName("com.mysql.jdbc.jdbc2.optional.MysqlDataSource");

to

hikari.setDataSourceClassName("com.mysql.cj.jdbc.MysqlDataSource");

@NiklasEi
Copy link
Owner

Thanks for the heads up!
I currently do not have a test setup with MySQL and will need some time to set everything up again, but I'll get to it.

@NiklasEi
Copy link
Owner

Since I am still missing a decent test setup, could one of you please verify, that https://github.com/NiklasEi/gamebox/releases/download/v3.3.1/GameBox.jar solves this issue? I will upload the build to SpigotMC then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants