You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not necessarily complaining that Quarkus is failing. It is more the how which I think is the issue, as there there is no documentation on it, or at least it didn't catch my eye. That said, a streamlined "let me handle that for you" would be awesome, if the information is there. Not sure if it is feasible though.
Build fails with a message like: "We have 2 different JDBC drivers on classpath, which causes native builds to fail. Consider using whatever you guys consider the best approach to solve this."
Actual behavior
Build fails with:
[quarkus-xxxx-1.0.0-runner:25] classlist: 2,411.74 ms, 0.94 GB
[quarkus-xxxx-1.0.0-runner:25] (cap): 561.60 ms, 0.94 GB
WARNING: Method java.sql.SQLXML.<init>() not found.
[quarkus-xxxx-1.0.0-runner:25] setup: 1,956.32 ms, 0.94 GB
10:25:31,024 INFO [org.jbo.threads] JBoss Threads version 3.2.0.Final
To see how the classes got initialized, use --trace-class-initialization=java.sql.DriverManager
[quarkus-xxxx-1.0.0-runner:25] analysis: 18,654.34 ms, 2.65 GB
Error: Classes that should be initialized at run time got initialized during image building:
java.sql.DriverManager the class was requested to be initialized at run time (from the command line). To see why java.sql.DriverManager got initialized use --trace-class-initialization=java.sql.DriverManager
com.oracle.svm.core.util.UserError$UserException: Classes that should be initialized at run time got initialized during image building:
java.sql.DriverManager the class was requested to be initialized at run time (from the command line). To see why java.sql.DriverManager got initialized use --trace-class-initialization=java.sql.DriverManager
at com.oracle.svm.core.util.UserError.abort(UserError.java:68)
at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.checkDelayedInitialization(ConfigurableClassInitialization.java:539)
at com.oracle.svm.hosted.classinitialization.ClassInitializationFeature.duringAnalysis(ClassInitializationFeature.java:226)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$8(NativeImageGenerator.java:740)
at com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:70)
at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:740)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:563)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:476)
at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1407)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Error: Image build request failed with exit status 1
I could see how this would easily be fixed by having two dedicated profiles in pom.xml, but as mentioned, the error message left me staring at it like "...what?".
For the "perfect world scenario": the information which driver to use could be extracted from quarkus.datasource.db-kind in application.properties if present. I have no idea if that is even possible, or if that is just too big of an effort for this.
The text was updated successfully, but these errors were encountered:
native build used: quay.io/quarkus/ubi-quarkus-native-image:21.1-java11 (FedoraCore 34 podman version 3.2.3)
fails with:
Error: Classes that should be initialized at run time got initialized during image building:
java.sql.DriverManager the class was requested to be initialized at run time (from jar:file:///project/lib/com.oracle.database.jdbc.ojdbc8-21.1.0.0.jar!/META-INF/native-image/native-image.properties). To see why java.sql.DriverManager got initialized use --trace-class-initialization=java.sql.DriverManager
com.oracle.svm.core.util.UserError$UserException: Classes that should be initialized at run time got initialized during image building:
java.sql.DriverManager the class was requested to be initialized at run time (from jar:file:///project/lib/com.oracle.database.jdbc.ojdbc8-21.1.0.0.jar!/META-INF/native-image/native-image.properties). To see why java.sql.DriverManager got initialized use --trace-class-initialization=java.sql.DriverManager
at com.oracle.svm.core.util.UserError.abort(UserError.java:68)
Build is successful in both cases when oracle or postgres jdbc dependency is removed.
Introduction
I'm not necessarily complaining that Quarkus is failing. It is more the how which I think is the issue, as there there is no documentation on it, or at least it didn't catch my eye. That said, a streamlined "let me handle that for you" would be awesome, if the information is there. Not sure if it is feasible though.
Describe the bug
In your pom.xml add:
mvn clean package -Pnative
Expected behavior
Either of:
Actual behavior
Build fails with:
To Reproduce
I'll add a reproducer shortly.EDIT: https://github.com/j-be/quarkus-16998
Steps to reproduce the behavior:
./mvnw clean package -DskipTests -Pnative
Configuration
Not relevant.
Output of
uname -a
Linux hawk 5.4.0-72-generic #80-Ubuntu SMP Mon Apr 12 17:35:00 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
GraalVM version (if different from Java)
Provided by:
Quarkus version or git rev
1.13.3.Final
Build tool
Additional context
I could see how this would easily be fixed by having two dedicated profiles in
pom.xml
, but as mentioned, the error message left me staring at it like "...what?".For the "perfect world scenario": the information which driver to use could be extracted from
quarkus.datasource.db-kind
inapplication.properties
if present. I have no idea if that is even possible, or if that is just too big of an effort for this.The text was updated successfully, but these errors were encountered: