-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Native compilation: Detected an instance of Random/SplittableRandom class in the image heap - java.security.SecureRandom #26835
Comments
/cc @sberyozkin |
@zakkak We can add some general advice how to deal with such errors, to the Native docs. I can do it, as far as I recall we reinitialized the affected code in Quarkus but I'm not sure what are the current way to handle it with the arguments, let me know please and I'll update the docs |
I agree, this is not a Quarkus issue. the
Yes it would make sense to have some documentation around this kind of issues. For Random/SplittableRandom I have written https://foivos.zakkak.net/tutorials/working-with-randoms-native-images/ which we could adapt to quarkus (this is actually in my todo list but with low priority so feel free to take over :) ). Note, however, that in this particular case even after solving the Random/SplittableRandom issue it looks like there are some "optional" dependencies that should be made unreachable through substitutions or explicitly added to the list of dependencies to allow the build to proceed (see #25526 (comment)). |
@zakkak Hi, that tutorial you have added is very good, I'd just link to it from the Quarkus docs |
@sberyozkin @zakkak Thank you guys for the fast response. I will check out the links and docs. |
Small Update: |
Fixes quarkusio#26835 (cherry picked from commit 31a6330)
To add this to a maven build you can configure the parameter |
Describe the bug
When i try to Native compile my Application i got this error.
After run
mvnw package -Pnative -Dquarkus.native.additional-build-args="--trace-object-instantiation=java.security.SecureRandom"
I get the following StackTracke
When i build with the following additional-build-args in my application.properties
"--initialize-at-run-time=com.sap.conn.rfc.engine.GUID"
I got this error
Expected behavior
After adding the --initialize-at-run-time=com.sap.conn.rfc.engine.GUID it should work i guess
Actual behavior
No response
How to Reproduce?
I can give access to the private repository if really needed to selected ppl.
Output of
uname -a
orver
none
Output of
java -version
openjdk version "17.0.3" 2022-04-19 OpenJDK Runtime Environment GraalVM CE 22.1.0 (build 17.0.3+7-jvmci-22.1-b06) OpenJDK 64-Bit Server VM GraalVM CE 22.1.0 (build 17.0.3+7-jvmci-22.1-b06, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.10.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.4
Additional information
No response
The text was updated successfully, but these errors were encountered: