Prism-Bukkit icon indicating copy to clipboard operation
Prism-Bukkit copied to clipboard

setDriverClassName by default.

Open Rothes opened this issue 3 years ago • 2 comments

Fixes this error on Arclight 1.18.1.

[23:47:55 WARN] [Prism]: Plugin Prism v2.1.8-CN-211023-23 generated an exception while executing task 42
java.lang.RuntimeException: Failed to get driver instance for jdbcUrl=jdbc:mysql://127.0.0.1:3306/test_prism?useUnicode=true&characterEncoding=UTF-8&useSSL=false
        at com.botsko.prism.libs.hikari.util.DriverDataSource.<init>(DriverDataSource.java:114) ~[?:?]
        at com.botsko.prism.libs.hikari.pool.PoolBase.initializeDataSource(PoolBase.java:331) ~[?:?]
        at com.botsko.prism.libs.hikari.pool.PoolBase.<init>(PoolBase.java:114) ~[?:?]
        at com.botsko.prism.libs.hikari.pool.HikariPool.<init>(HikariPool.java:108) ~[?:?]
        at com.botsko.prism.libs.hikari.HikariDataSource.<init>(HikariDataSource.java:81) ~[?:?]
        at me.botsko.prism.database.mysql.MySqlPrismDataSource.createDataSource(MySqlPrismDataSource.java:109) ~[?:?]
        at me.botsko.prism.database.mysql.MySqlPrismDataSource.createDataSource(MySqlPrismDataSource.java:26) ~[?:?]
        at me.botsko.prism.database.sql.SqlPrismDataSource.<init>(SqlPrismDataSource.java:53) ~[?:?]
        at me.botsko.prism.database.mysql.MySqlPrismDataSource.<init>(MySqlPrismDataSource.java:53) ~[?:?]
        at me.botsko.prism.database.PrismDatabaseFactory.createDataSource(PrismDatabaseFactory.java:106) ~[?:?]
        at me.botsko.prism.Prism.lambda$onEnable$6(Prism.java:440) ~[?:?]
        at org.bukkit.craftbukkit.v1_18_R1.scheduler.CraftTask.run(CraftTask.java:82) ~[arclight-1.18.1-1.0.0-98307237.jar%2367!:arclight-1.18.1-1.0.0-98307237]
        at org.bukkit.craftbukkit.v1_18_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) [arclight-1.18.1-1.0.0-98307237.jar%2367!:arclight-1.18.1-1.0.0-98307237]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
        at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.sql.SQLException: No suitable driver
        at java.sql.DriverManager.getDriver(DriverManager.java:299) ~[java.sql:?]
        at com.botsko.prism.libs.hikari.util.DriverDataSource.<init>(DriverDataSource.java:106) ~[?:?]
        ... 15 more

Rothes avatar Jan 08 '22 17:01 Rothes

Setting the DriverClassName should fix this issue, would be great if someone with write access could review it as well. Thanks.

I've already reviewed this and provided a response (see above), but haven't heard back. Still not sure this change is necessary, since you can set the ClassName in the hikari.properties file. I was waiting for @Rothes to confirm if this solves their issue.

Maybe the proper solution is for Prism to just set this as a default in the hikari config, but I'm concerned merging this current change will prevent server owners from changing that property, but I could be wrong.

addstar avatar Apr 09 '22 03:04 addstar

Setting the DriverClassName should fix this issue, would be great if someone with write access could review it as well. Thanks.

I've already reviewed this and provided a response (see above), but haven't heard back. Still not sure this change is necessary, since you can set the ClassName in the hikari.properties file. I was waiting for @Rothes to confirm if this solves their issue.

Maybe the proper solution is for Prism to just set this as a default in the hikari config, but I'm concerned merging this current change will prevent server owners from changing that property, but I could be wrong.

I forgot to check. Now fixed

Rothes avatar Apr 09 '22 04:04 Rothes

This repository is no longer active. You can try to resubmit this at the current Prism repo here https://github.com/prism/PrismRefracted (athough, some of these older fix PRs were already adapted, please verify first)

viveleroi avatar Apr 13 '23 03:04 viveleroi