-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 #20396
Comments
Hi @vsevel , thanks for the report! Could you clarify why you're setting |
hi @Sanne, if I don't, I get an error related to when I specify:
I get this build error:
|
I am not sure about the |
@Sanne I was able to drop |
I was able to reproduce in a small example, without Quarkus, just using Here is the main program:
And pom:
To reproduce:
The execution gives:
if I change the classpath to
So the issue arises by just having the I can see the driver has a bunch of config files in I am using:
and oracle driver @Sanne I know it is not a Quarkus issue, but how do you think we could make progress on this? thanks. |
I missed it initially, but it is simply caused by:
Is there any way we can work around this in Quarkus? |
I extracted the content of the driver jar, removed
Using this additional code in the program:
It does not mean the hack is all what is needed. Is there any way you could get oracle to produce a new driver? thanks. |
hi @vsevel - thank you very much, such a simple reproducer is great to have. I'll try to look at it today but I'm not sure I can do much about it... just curious to learn more about it. Regarding the See also oracle/graal#3932 , oracle/graal#2762 , oracle/graal#3929 Added some more notes just now: |
thanks for the update @Sanne just to clarify:
to investigate the issue further, I repackaged a new oracle driver without the if I have not missed anything, we only need a version of the driver without |
But where is this |
in the oracle driver |
i.c. thanks... I didn't expect that at all, it's concerning that a library makes the unilateral decision to disable JDK shared functionality rather than patching their own code. I suppose it was hard for them to fix and the previous GraalVM version didn't support serialization, but still it seems a mistake to include hardcoded substitutions that make an assumption about which version of GraalVM will be used - that's not for a library to decide. I've opened #21069 as one aspect to handle such cases. Not sure how to handle this specific problem ... honestly I think your best option is to open a support request with Oracle and ask them to fix the driver. |
yes. right. I was hoping you may have some weight on getting them to do things right, specifically in the context of graalvm and the Native Image Committer Community Meeting. it might a good topic to bring to @christianwimmer. |
fyi, the issue has been reproduced by oracle support. a bug should be submitted soon to the dev team. |
you motivated me to have another look, and it turned out it wasn't that complicated to workaround :) See #21929 |
excellent @Sanne |
Right, this patch will do the same. I should add that I had concerns about following this approach of blindly modifying a non-OSS library as we couldn't know all substitutions and their nature, but since I've been working on a POC for #21069 and while doing it, it became clearer that the tooling can generate enough insight for this to be controllable. And thanks for your test!
Right this was simpe today, it could get uglier. But we can always delete a substitution and provide an alternative in our extenstions; or we can also actually modify bytecode with a different build item. It's similar to "substitutions" but it works on the bytecode level so we can even modify things in such a way to have effect in JVM mode - potentially. Hopefully we'll never need to do such things again, but it's reassuring to see that our transformations are this powerful and flexible so that in case of need there's always a way out. We'll of course always favour upstream patching, but it's good to have ways to expedite things.
Thanks! We'll also keep working on #21069 to help spotting new unexpected subtitutions, and possibly watch for such ones which we expet to get removed. And we definitely need to keep working with the teams maintaining the upstreams, such as Oracle JDBC in thi case. |
FYI, oracle support says: The development team has fixed the issue and they are working on the next steps to release the fix. |
Awesome, many thanks @vsevel for making that happen! |
the fix will be in version
|
Describe the bug
Starting in 2.2.2, adding some serialization code and the oracle driver in the same application will lead to a
java.lang.IllegalStateException: Object serialization is currently not supported
when attempting to serialize objects.This is working fine in 2.2.1.
Expected behavior
no regression. serialization code works as expected.
Actual behavior
How to Reproduce?
create a sample application.
add the following dependency:
add the following build args:
add the following service:
and the following test:
launch a native build, in 2.2.1 it works, in 2.2.2 it fails. it fails also on 2.3.0.CR1.
Output of
uname -a
orver
No response
Output of
java -version
No response
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.2.2
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: