-
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
Integration tests using postgresql fail to compile natively with Java 17 #21359
Comments
@zakkak tells me that the relevant code in the PG Java driver is: https://github.com/pgjdbc/pgjdbc/blob/master/pgjdbc/src/main/java/org/postgresql/util/internal/Unsafe.java It's interesting that it's only surfacing during a native-image build. It seems to suggest it's a latent bug bound to surface in plain JVM mode when run on JDK 17 (which has stronger encapsulation enabled) if the relevant code path is being triggered. Apparently it isn't at this point with existing tests. To fix this properly, I'd suggest to bring this to the attention of the PG driver developers (file an issue). Then the question is why they are using JDK-internal API for this use-case. It could be that that use-case may be supported via some already existing public JDK API. If there isn't and no equivalent API exists, an OpenJDK bug should get filed to add it. |
I don't pretend to know what the driver is doing here (@Sanne perhaps knows), but could we not solve this with a simple substitution that returns |
I also don't know what the driver is doing. Update: it looks like such a substitution could result in some configurations not working. FWIW the internal api reference was added in pgjdbc/pgjdbc@705b660 |
But does this happen in practice? |
encryption is commonly used so it would be sad to have to disable support for it. Would be good to know more about this "credentials caching" check specifically though, not sure what its implications are. |
Same error here. I tried the build both on MacOS and CentOS.
|
I've figured out what is going on; the "unresolved type" mentioned by the error message is the method Apparently in Java 17 this module is not exposed by default, so one needs to add an explicit export instruction to make this available to the pg client code. The "normal" syntax for this would be to pass So a valid workaround is to have
but we should fix this issue by setting such flags automatically. |
Describe the bug
Native compilation of integration tests using postgresql fails with GraalVM CE 21.3 Java17 (
quay.io/quarkus/ubi-quarkus-native-image:21.3-java17
)Namely the following tests fail to build:
See https://github.com/graalvm/mandrel/actions/runs/1445890803
Expected behavior
Tests should build and run.
Actual behavior
Tests fail to build with:
How to Reproduce?
Output of
uname -a
orver
5.14.15-200.fc34.x86_64 #1 SMP Wed Oct 27 15:53:30 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
OpenJDK 64-Bit Server VM Temurin-11.0.13+8 (build 11.0.13+8, mixed mode)
GraalVM version (if different from Java)
OpenJDK 64-Bit Server VM GraalVM CE 21.3.0 (build 17.0.1+12-jvmci-21.3-b05, mixed mode, sharing)
Quarkus version or git rev
132d9ea
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Additional information
The issue is only reproducible on Java 17 and it seems to be resolved by passing:
Note that this is not a Quarkus issue. I am able to reproduce it using just GraalVM CE and https://github.com/zakkak/issue-reproducers/tree/krb5-credentials-failure-java17
The text was updated successfully, but these errors were encountered: