JiriOndrusek commented on issue #3256:
URL: https://github.com/apache/camel-quarkus/issues/3256#issuecomment-957281412


   First impression is that everything looks like it should work. 
   I tried some different scenarios and results show another problem with 
oracle jdbc.
   
   If I run tests (native) with `h2` (default configuration), results are 
successful.
   If I add `quarkus-jdbc-oracle` into dependencies, jvm tests are successful, 
but native image build fails.
   
   ```
           <dependency>
               <groupId>io.quarkus</groupId>
               <artifactId>quarkus-jdbc-oracle</artifactId>
           </dependency>
   ```
   
   Exception is:
   ```
   [camel-quarkus-integration-test-sql-2.5.0-SNAPSHOT-runner:25]     analysis:  
50,242.45 ms,  5.67 GB
   [camel-quarkus-integration-test-sql-2.5.0-SNAPSHOT-runner:25]      [total]:  
58,229.00 ms,  5.67 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 feature io.quarkus.runner.AutoFeature.beforeAnalysis with 
'DriverManager.class'). 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 feature io.quarkus.runner.AutoFeature.beforeAnalysis with 
'DriverManager.class'). 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:555)
        at 
com.oracle.svm.hosted.classinitialization.ClassInitializationFeature.duringAnalysis(ClassInitializationFeature.java:169)
        at 
com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$12(NativeImageGenerator.java:730)
        at 
com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:71)
        at 
com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:730)
        at 
com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:532)
        at 
com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:491)
        at 
com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:380)
        at 
com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:543)
        at 
com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:119)
        at 
com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:573)
   # Printing build artifacts to: 
/project/camel-quarkus-integration-test-sql-2.5.0-SNAPSHOT-runner.build_artifacts.txt
   Error: Image build request failed with exit status 1
   ```
   This exception is the same as in this closed issue - 
https://github.com/apache/camel-quarkus/issues/2448
   
   Interesting fact is, that if there is only `quarkus-jdbc-oracle` and no 
`h2`, image build succeeds (failure happens in test execution)
   
   1. From my POV having `quarkus-jdbc-h2` and `quarkus-jdbc-oracle` in one 
project should work. 
   2. We should enable tests of different db types on CI 
(https://github.com/apache/camel-quarkus/issues/3083) and then we should also 
created something like `sql-grouped` to be sure that all jdbc drivers work 
together.
   What do you think @ppalaga? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to