Closed jbiancot closed 1 month ago
It looks like you're missing some reachability metadata for the MySQL JDBC Driver so it's unable to load some types reflectively. This could be because you're using the old Maven coordinates rather than the new ones. The new coordinates will match those used in the shared reachability metadata repository and allow its metadata to be used.
If the above doesn't help, it may be that you've configured JDBC in a way that means that it performs additional reflection and requires additional metadata or that the use of reflection has changed between 8.0.31 and 8.0.33. In this case, you could provide some additional metadata of your own to enable more use of reflection. You may also want to contribute this additional metadata back to the reachability metadata repository so that everyone benefits.
If you have any further questions, please follow up on Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements.
@wilkinsona I tried a few things, it didn't work.
src/main/resources/META-INF/native-image] tree
.
└── com.mysql
├── index.json
└── mysql-connector-j
└── 8.0.31
├── reflect-config.json
└── resource-config.json
even I tried this:
native-image] tree
.
├── com.mysql
│ ├── index.json
│ └── mysql-connector-j
│ └── 8.0.31
│ ├── reflect-config.json
│ └── resource-config.json
└── com.zaxxer
└── HikariCP
└── 5.0.1
├── jni-config.json
├── proxy-config.json
├── reflect-config.json
├── resource-config.json
└── serialization-config.json
Then I don't understand how a feature so "game changer" as build native images "binaries", that only wants to implement basic interaction to one of the most popular databases as MySQL is, using one of the best connection pools like HikariCP, then I feel I need to do magic in order to make it work.
This needs work.
@jbiancot Please remember that we're providing this software and trying to support it the best we can for free. Adding comments such as "This needs work." isn't a great way to get the help you're looking for!
Andy has already requested that you ask this question on https://stackoverflow.com rather that use this issue tracker, which we prefer to keep for bugs and enhancements. He also hinted that you may be using the incorrect group ID for the MySQL connector. Looking at the build.gradle
file you attached, this looks likely to be the problem. If you do ask your question on https://stackoverflow.com, I would suggest providing a minimal reproducible example so that folks trying to help can reproduce the problem.
Hi @philwebb I have added the project to my website, if you have some time you can give it a try. I cleaned it a much as possible to make it very simple. You will need to have a MySQL/MariaDB database, setup connection string, e.g: setup IP, username and password. It will just try to get the version number from the database.
https://jesusbianco.com/stackoverflow/Test1-Native-Data-MySQL.zip
I also posted the question on Stack Overflow
Hello there,
I have a simple SpringBoot 3.3.4 app, I am trying a basic task, open a connection pool using Hikari, running a couple of SQL selects against a MySQL database. I am able to compile using:
./gradlew nativeCompile
Running it on a Apple Mac with M3 "arm64 chip"
but when I tried to run it, I am getting some issues. If I modify on gradle file with:
I can run it successfully using: java -jar build/libs/...
Some files it might be useful:
Gradle file: build.gradle.txt
Error on runtime / start-up errors.txt