-
Notifications
You must be signed in to change notification settings - Fork 41k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
oracle driver and serialization conflict #34819
Comments
Hello, I was about to open the same bug today 😄 My solution, other then 'repackaged the oracle driver', was to downgrade the ojdbc version to 21.1.0.0, since the class performing that substitution was introduced in v21.3.0.0. Here's a repo to replicate the issue (don't need to use the ojdbc, just being in the classpath toghether with spring-boot-starter-logging and using a logback.xml or logback-spring.xml) : spring-native-ojdbc Environment
|
@damianopittori thanks for the sample. @a483210 this is an issue in the Oracle driver that disables core JDK features via a substitution. There's nothing we can do about it. I'll do my best to share the issue but if you have a support contract, please report it as well. |
The issue has been fixed in the latest version of the Oracle driver |
@damianopittori thanks. I also got in touch with the team at Oracle and they will backport the fix to 21.9 if I understood correctly. |
@snicoll Even with 21.9 version, able to reproduce this issue. I'm using spring boot 3.2.2 and native-image-community:21-ol8 jdk version |
@maradanasai Oracle may not yet have back ported the fix to 21.9, we don't know. You'll have to ask Oracle for up-to-date information on the status of any back port. |
Got it @wilkinsona Are there any work arounds to get it fixed temporarily? |
@a483210 describes their approach above. You may want to try doing the same. Beyond that, you may want to ask the GraalVM community if it's possible to ignore a substitution or to reverse a substitution's effects so that serialization isn't disabled. |
Description
Introducing
com.oracle.database.jdbc:ojdbc11:21.9.0.0
into the application and then packaging it as Native will result in a serialization error.The error is consistent with quarkusio oracle driver and serialization conflict.
Cause of the error
The reason for the error is that there is a file
oracle.nativeimage.Target_java_io_ObjectStreamClass
in theoracle driver
, which replaces the code ofjava.io.ObjectStreamClass
during graalVM compilation.Solution
In quarkus, there is a RemovedResourceBuildItem that can delete a class file of a certain Jar package before compilation. This is quarkus’s solution.
I haven’t found anything similar in SpringBoot yet, so I currently repackaged the oracle driver and uploaded it to my own maven repository.
Is there a more elegant solution in SpringBoot?
Exception prompt
Environment
Steps to reproduce
The text was updated successfully, but these errors were encountered: