https://kotlinlang.org logo
r

redenergy

01/24/2020, 11:44 AM
How to debug and fix issues with Database class initialization like this? I have included exposed-jdbc dependency but the exception is still here. Quick googling yielded only one issue on github without a proper solution. I suspect it has something to do with different classloaders but I am not sure where to start
Copy code
java.lang.NoClassDefFoundError: Could not initialize class org.jetbrains.exposed.sql.Database
	at gloomyfolken.bundle.common.mysql.MysqlContext.<init>(MysqlContext.kt:33)
	at gloomyfolken.bundle.common.mysql.MysqlWorkerThread.openConnection(MysqlWorkerThread.kt:98)
	at gloomyfolken.bundle.common.mysql.MysqlWorkerThread.run(MysqlWorkerThread.kt:109)
Caused by: java.lang.IllegalStateException: Can't load implementation for DatabaseConnectionAutoRegistration
	at org.jetbrains.exposed.sql.Database.<clinit>(Database.kt:64)
	... 3 more
If anyone is curious or struggling with the same issue, make sure you copy folder META-INT/services/ from exposed-jdbc jar into your application jar