Closed kohlschuetter closed 4 months ago
@czp3009 Thanks for bringing this up!
I have fixed the cause and improved the tooling to prevent mysql-specific bugs with GraalVM. Please verify with the latest junixsocket-2.10.0-SNAPSHOT version.
If I'm not mistaken, the latest code should be on the master branch. But after looking at the source code, I'm confused
reflect-config.json in junixsocket-mysql only add reflection hints for class in mysql package, not include AFUNIXDatabaseSocketFactoryCJ
in junixsocket. In many cases, user use junixsockets via a JDBC url(it's string), in which case graalvm needs to dynamically reflect to a specific SocketFactory implementation class such as AFUNIXDatabaseSocketFactoryCJ
. So I think it's important to at least include a reflection hint for this class
Another point of confusion is that, AFUNIXDatabaseSocketFactoryTest only test legacy SocketFactory, not CJ style SocketFactory. AFUNIXDatabaseSocketFactory
and AFUNIXDatabaseSocketFactoryCJ
are two different classes, and both may be used by user via JDBC url
A typical JDBC Url Usage: "jdbc:mysql://localhost/db?socketFactory=org.newsclub.net.mysql.AFUNIXDatabaseSocketFactoryCJ&junixsocket.file=/tmp/mysql.sock"
In summary, i think should add reflective hints for AFUNIXDatabaseSocketFactory
and AFUNIXDatabaseSocketFactoryCJ
to cover JDBC url usage
Ah, good point, you're right, @czp3009
I've updated the config file. Please re-test. Thanks!
i read the new https://github.com/kohlschutter/junixsocket/blob/main/junixsocket-mysql/src/main/resources/META-INF/native-image/com.kohlschutter.junixsocket/junixsocket-mysql/reflect-config.json, it looks very well, thanks your work!
junixsocket 2.10.0 has been released. Please verify and re-open if necessary. Thanks again for reporting , @czp3009 !
As per @czp3009 in https://github.com/kohlschutter/junixsocket/issues/152