Skip to content
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

Closed
Cobas91 opened this issue Jul 20, 2022 · 9 comments · Fixed by #27106
Labels
area/security env/windows Impacts Windows machines kind/bug Something isn't working
Milestone

Comments

@Cobas91
Copy link

Cobas91 commented Jul 20, 2022

Describe the bug

When i try to Native compile my Application i got this error.

Fatal error: org.graalvm.compiler.debug.GraalError: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Detected an instance of Random/SplittableRandom class in the image heap. Instances created during image generation have cached seed values and don't behave as expected.  To see how this object got instantiated use --trace-object-instantiation=java.security.SecureRandom. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
        at com.oracle.graal.pointsto.util.AnalysisFuture.setException(AnalysisFuture.java:49)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:269)
        at com.oracle.graal.pointsto.util.AnalysisFuture.ensureDone(AnalysisFuture.java:63)
        at com.oracle.graal.pointsto.heap.ImageHeapScanner.lambda$postTask$9(ImageHeapScanner.java:611)
        at com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:193)
        at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:177)
        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Detected an instance of Random/SplittableRandom class in the image heap. Instances created during image generation have cached seed values and don't behave as expected.  To see how this object got instantiated use --trace-object-instantiation=java.security.SecureRandom. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
        at com.oracle.svm.hosted.image.DisallowedImageHeapObjectFeature.error(DisallowedImageHeapObjectFeature.java:173)
        at com.oracle.svm.core.image.DisallowedImageHeapObjects.check(DisallowedImageHeapObjects.java:62)
        at com.oracle.svm.hosted.image.DisallowedImageHeapObjectFeature.replacer(DisallowedImageHeapObjectFeature.java:149)
        at com.oracle.graal.pointsto.meta.AnalysisUniverse.replaceObject(AnalysisUniverse.java:582)
        at com.oracle.svm.hosted.ameta.AnalysisConstantReflectionProvider.replaceObject(AnalysisConstantReflectionProvider.java:257)
        at com.oracle.svm.hosted.ameta.AnalysisConstantReflectionProvider.interceptValue(AnalysisConstantReflectionProvider.java:228)
        at com.oracle.svm.hosted.heap.SVMImageHeapScanner.transformFieldValue(SVMImageHeapScanner.java:126)
        at com.oracle.graal.pointsto.heap.ImageHeapScanner.onFieldValueReachable(ImageHeapScanner.java:331)
        at com.oracle.graal.pointsto.heap.ImageHeapScanner.onFieldValueReachable(ImageHeapScanner.java:310)
        at com.oracle.graal.pointsto.heap.ImageHeapScanner.lambda$computeTypeData$1(ImageHeapScanner.java:153)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        ... 10 more

After run
mvnw package -Pnative -Dquarkus.native.additional-build-args="--trace-object-instantiation=java.security.SecureRandom"
I get the following StackTracke

Fatal error: org.graalvm.compiler.debug.GraalError: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Detected an instance of Random/SplittableRandom class in the image heap. Instances created during image generation have cached seed values and don't behave as expected.  Object has been initialized by the com.sap.conn.rfc.engine.GUID class initializer with a trace:
        at java.security.SecureRandom.<init>(SecureRandom.java:224)
        at com.sap.conn.rfc.engine.GUID.<clinit>(GUID.java:38)
. Try avoiding to initialize the class that caused initialization of the object. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
        at com.oracle.graal.pointsto.util.AnalysisFuture.setException(AnalysisFuture.java:49)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:269)
        at com.oracle.graal.pointsto.util.AnalysisFuture.ensureDone(AnalysisFuture.java:63)
        at com.oracle.graal.pointsto.heap.ImageHeapScanner.lambda$postTask$9(ImageHeapScanner.java:611)
        at com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:193)
        at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:177)
        at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Detected an instance of Random/SplittableRandom class in the image heap. Instances created during image generation have cached seed values and don't behave as expected.  Object has been initialized by the com.sap.conn.rfc.engine.GUID class initializer with a trace:
        at java.security.SecureRandom.<init>(SecureRandom.java:224)
        at com.sap.conn.rfc.engine.GUID.<clinit>(GUID.java:38)
. Try avoiding to initialize the class that caused initialization of the object. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
        at com.oracle.svm.hosted.image.DisallowedImageHeapObjectFeature.error(DisallowedImageHeapObjectFeature.java:173)
        at com.oracle.svm.core.image.DisallowedImageHeapObjects.check(DisallowedImageHeapObjects.java:62)
        at com.oracle.svm.hosted.image.DisallowedImageHeapObjectFeature.replacer(DisallowedImageHeapObjectFeature.java:149)
        at com.oracle.graal.pointsto.meta.AnalysisUniverse.replaceObject(AnalysisUniverse.java:582)
        at com.oracle.svm.hosted.ameta.AnalysisConstantReflectionProvider.replaceObject(AnalysisConstantReflectionProvider.java:257)
        at com.oracle.svm.hosted.ameta.AnalysisConstantReflectionProvider.interceptValue(AnalysisConstantReflectionProvider.java:228)
        at com.oracle.svm.hosted.heap.SVMImageHeapScanner.transformFieldValue(SVMImageHeapScanner.java:126)
        at com.oracle.graal.pointsto.heap.ImageHeapScanner.onFieldValueReachable(ImageHeapScanner.java:331)
        at com.oracle.graal.pointsto.heap.ImageHeapScanner.onFieldValueReachable(ImageHeapScanner.java:310)
        at com.oracle.graal.pointsto.heap.ImageHeapScanner.lambda$computeTypeData$1(ImageHeapScanner.java:153)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        ... 10 more

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

Error: Unsupported features in 2 methods
Detailed message:
Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: com.sap.jdsr.writer.DsrIPassport. This error is reported at image build time because class com.sap.conn.jco.rt.ClientConnection is registered for linking at image build time by command line
Trace:
        at parsing com.sap.conn.jco.rt.ClientConnection.beginCall(ClientConnection.java:263)
Call path from entry point to com.sap.conn.jco.rt.ClientConnection.beginCall():
        at com.sap.conn.jco.rt.ClientConnection.beginCall(ClientConnection.java:248)
        at com.sap.conn.jco.rt.ClientConnection.execute(ClientConnection.java:1043)
        at com.sap.conn.jco.rt.ClientConnection.execute(ClientConnection.java:940)
        at com.sap.conn.jco.rt.RfcDestination.execute(RfcDestination.java:1140)
        at com.sap.conn.jco.rt.RfcDestination.execute(RfcDestination.java:1114)
        at com.sap.conn.jco.rt.AbapFunction.execute(AbapFunction.java:302)
        at com.zapliance.modules.duniverseCownload.SAPTableQuerySimple.queryTable(SAPTableQuerySimple.java:207)
        at com.zapliance.modules.duniverseCownload.SAPTableQuerySimple.queryTable(SAPTableQuerySimple.java:96)
        at com.zapliance.modules.duniverseCownload.ConsoleProcessor.licenseToken(ConsoleProcessor.java:950)
        at com.zapliance.modules.duniverseCownload.ConsoleProcessor.update(ConsoleProcessor.java:625)
        at com.zapliance.continuous.service.CownloadService.lambda$createAndStartCownloadTask$0(CownloadService.java:124)
        at com.zapliance.continuous.service.CownloadService$$Lambda$1400/0x00000007c3804b58.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:833)
        at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:704)
        at com.oracle.svm.core.windows.WindowsPlatformThreads.osThreadStartRoutine(WindowsPlatformThreads.java:143)
        at com.oracle.svm.core.code.IsolateEnterStub.WindowsPlatformThreads_osThreadStartRoutine_77cb625316abfaaa1a6261614dc5eb03b33d1f85(generated:0)
Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: com.sap.util.monitor.jarm.TaskMonitor. This error is reported at image build time because class com.sap.conn.jco.util.Jarm is registered for linking at image build time by command line
Trace:
        at parsing com.sap.conn.jco.util.Jarm.getRequestMonitor(Jarm.java:69)
Call path from entry point to com.sap.conn.jco.util.Jarm.getRequestMonitor(String, String):
        at com.sap.conn.jco.util.Jarm.getRequestMonitor(Jarm.java:67)
        at com.sap.conn.jco.rt.AbapRepository.queryFunctionTemplate(AbapRepository.java:921)
        at com.sap.conn.jco.rt.AbapRepository.queryFunctionTemplate(AbapRepository.java:549)
        at com.sap.conn.jco.rt.AbapRepository.getFunctionTemplate(AbapRepository.java:775)
        at com.sap.conn.jco.rt.BasicRepository.getFunction(BasicRepository.java:152)
        at com.zapliance.modules.duniverseCownload.SAPTableQuerySimple.queryTable(SAPTableQuerySimple.java:162)
        at com.zapliance.modules.duniverseCownload.SAPTableQuerySimple.queryTable(SAPTableQuerySimple.java:96)
        at com.zapliance.modules.duniverseCownload.ConsoleProcessor.licenseToken(ConsoleProcessor.java:950)
        at com.zapliance.modules.duniverseCownload.ConsoleProcessor.update(ConsoleProcessor.java:625)
        at com.zapliance.continuous.service.CownloadService.lambda$createAndStartCownloadTask$0(CownloadService.java:124)
        at com.zapliance.continuous.service.CownloadService$$Lambda$1400/0x00000007c3804b58.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:833)
        at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:704)
        at com.oracle.svm.core.windows.WindowsPlatformThreads.osThreadStartRoutine(WindowsPlatformThreads.java:143)
        at com.oracle.svm.core.code.IsolateEnterStub.WindowsPlatformThreads_osThreadStartRoutine_77cb625316abfaaa1a6261614dc5eb03b33d1f85(generated:0)

com.oracle.svm.core.util.UserError$UserException: Unsupported features in 2 methods
Detailed message:
Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: com.sap.jdsr.writer.DsrIPassport. This error is reported at image build time because class com.sap.conn.jco.rt.ClientConnection is registered for linking at image build time by command line
Trace:
        at parsing com.sap.conn.jco.rt.ClientConnection.beginCall(ClientConnection.java:263)
Call path from entry point to com.sap.conn.jco.rt.ClientConnection.beginCall():
        at com.sap.conn.jco.rt.ClientConnection.beginCall(ClientConnection.java:248)
        at com.sap.conn.jco.rt.ClientConnection.execute(ClientConnection.java:1043)
        at com.sap.conn.jco.rt.ClientConnection.execute(ClientConnection.java:940)
        at com.sap.conn.jco.rt.RfcDestination.execute(RfcDestination.java:1140)
        at com.sap.conn.jco.rt.RfcDestination.execute(RfcDestination.java:1114)
        at com.sap.conn.jco.rt.AbapFunction.execute(AbapFunction.java:302)
        at com.zapliance.modules.duniverseCownload.SAPTableQuerySimple.queryTable(SAPTableQuerySimple.java:207)
        at com.zapliance.modules.duniverseCownload.SAPTableQuerySimple.queryTable(SAPTableQuerySimple.java:96)
        at com.zapliance.modules.duniverseCownload.ConsoleProcessor.licenseToken(ConsoleProcessor.java:950)
        at com.zapliance.modules.duniverseCownload.ConsoleProcessor.update(ConsoleProcessor.java:625)
        at com.zapliance.continuous.service.CownloadService.lambda$createAndStartCownloadTask$0(CownloadService.java:124)
        at com.zapliance.continuous.service.CownloadService$$Lambda$1400/0x00000007c3804b58.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:833)
        at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:704)
        at com.oracle.svm.core.windows.WindowsPlatformThreads.osThreadStartRoutine(WindowsPlatformThreads.java:143)
        at com.oracle.svm.core.code.IsolateEnterStub.WindowsPlatformThreads_osThreadStartRoutine_77cb625316abfaaa1a6261614dc5eb03b33d1f85(generated:0)
Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: com.sap.util.monitor.jarm.TaskMonitor. This error is reported at image build time because class com.sap.conn.jco.util.Jarm is registered for linking at image build time by command line
Trace:
        at parsing com.sap.conn.jco.util.Jarm.getRequestMonitor(Jarm.java:69)
Call path from entry point to com.sap.conn.jco.util.Jarm.getRequestMonitor(String, String):
        at com.sap.conn.jco.util.Jarm.getRequestMonitor(Jarm.java:67)
        at com.sap.conn.jco.rt.AbapRepository.queryFunctionTemplate(AbapRepository.java:921)
        at com.sap.conn.jco.rt.AbapRepository.queryFunctionTemplate(AbapRepository.java:549)
        at com.sap.conn.jco.rt.AbapRepository.getFunctionTemplate(AbapRepository.java:775)
        at com.sap.conn.jco.rt.BasicRepository.getFunction(BasicRepository.java:152)
        at com.zapliance.modules.duniverseCownload.SAPTableQuerySimple.queryTable(SAPTableQuerySimple.java:162)
        at com.zapliance.modules.duniverseCownload.SAPTableQuerySimple.queryTable(SAPTableQuerySimple.java:96)
        at com.zapliance.modules.duniverseCownload.ConsoleProcessor.licenseToken(ConsoleProcessor.java:950)
        at com.zapliance.modules.duniverseCownload.ConsoleProcessor.update(ConsoleProcessor.java:625)
        at com.zapliance.continuous.service.CownloadService.lambda$createAndStartCownloadTask$0(CownloadService.java:124)
        at com.zapliance.continuous.service.CownloadService$$Lambda$1400/0x00000007c3804b58.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:833)
        at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:704)
        at com.oracle.svm.core.windows.WindowsPlatformThreads.osThreadStartRoutine(WindowsPlatformThreads.java:143)
        at com.oracle.svm.core.code.IsolateEnterStub.WindowsPlatformThreads_osThreadStartRoutine_77cb625316abfaaa1a6261614dc5eb03b33d1f85(generated:0)

        at com.oracle.svm.core.util.UserError.abort(UserError.java:84)
        at com.oracle.svm.hosted.FallbackFeature.reportAsFallback(FallbackFeature.java:249)
        at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:754)
        at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:558)
        at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:515)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:407)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:585)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:128)
        at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:615)
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Unsupported features in 2 methods
Detailed message:
Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: com.sap.jdsr.writer.DsrIPassport. This error is reported at image build time because class com.sap.conn.jco.rt.ClientConnection is registered for linking at image build time by command line
Trace:
        at parsing com.sap.conn.jco.rt.ClientConnection.beginCall(ClientConnection.java:263)
Call path from entry point to com.sap.conn.jco.rt.ClientConnection.beginCall():
        at com.sap.conn.jco.rt.ClientConnection.beginCall(ClientConnection.java:248)
        at com.sap.conn.jco.rt.ClientConnection.execute(ClientConnection.java:1043)
        at com.sap.conn.jco.rt.ClientConnection.execute(ClientConnection.java:940)
        at com.sap.conn.jco.rt.RfcDestination.execute(RfcDestination.java:1140)
        at com.sap.conn.jco.rt.RfcDestination.execute(RfcDestination.java:1114)
        at com.sap.conn.jco.rt.AbapFunction.execute(AbapFunction.java:302)
        at com.zapliance.modules.duniverseCownload.SAPTableQuerySimple.queryTable(SAPTableQuerySimple.java:207)
        at com.zapliance.modules.duniverseCownload.SAPTableQuerySimple.queryTable(SAPTableQuerySimple.java:96)
        at com.zapliance.modules.duniverseCownload.ConsoleProcessor.licenseToken(ConsoleProcessor.java:950)
        at com.zapliance.modules.duniverseCownload.ConsoleProcessor.update(ConsoleProcessor.java:625)
        at com.zapliance.continuous.service.CownloadService.lambda$createAndStartCownloadTask$0(CownloadService.java:124)
        at com.zapliance.continuous.service.CownloadService$$Lambda$1400/0x00000007c3804b58.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:833)
        at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:704)
        at com.oracle.svm.core.windows.WindowsPlatformThreads.osThreadStartRoutine(WindowsPlatformThreads.java:143)
        at com.oracle.svm.core.code.IsolateEnterStub.WindowsPlatformThreads_osThreadStartRoutine_77cb625316abfaaa1a6261614dc5eb03b33d1f85(generated:0)
Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: com.sap.util.monitor.jarm.TaskMonitor. This error is reported at image build time because class com.sap.conn.jco.util.Jarm is registered for linking at image build time by command line
Trace:
        at parsing com.sap.conn.jco.util.Jarm.getRequestMonitor(Jarm.java:69)
Call path from entry point to com.sap.conn.jco.util.Jarm.getRequestMonitor(String, String):
        at com.sap.conn.jco.util.Jarm.getRequestMonitor(Jarm.java:67)
        at com.sap.conn.jco.rt.AbapRepository.queryFunctionTemplate(AbapRepository.java:921)
        at com.sap.conn.jco.rt.AbapRepository.queryFunctionTemplate(AbapRepository.java:549)
        at com.sap.conn.jco.rt.AbapRepository.getFunctionTemplate(AbapRepository.java:775)
        at com.sap.conn.jco.rt.BasicRepository.getFunction(BasicRepository.java:152)
        at com.zapliance.modules.duniverseCownload.SAPTableQuerySimple.queryTable(SAPTableQuerySimple.java:162)
        at com.zapliance.modules.duniverseCownload.SAPTableQuerySimple.queryTable(SAPTableQuerySimple.java:96)
        at com.zapliance.modules.duniverseCownload.ConsoleProcessor.licenseToken(ConsoleProcessor.java:950)
        at com.zapliance.modules.duniverseCownload.ConsoleProcessor.update(ConsoleProcessor.java:625)
        at com.zapliance.continuous.service.CownloadService.lambda$createAndStartCownloadTask$0(CownloadService.java:124)
        at com.zapliance.continuous.service.CownloadService$$Lambda$1400/0x00000007c3804b58.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:833)
        at com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:704)
        at com.oracle.svm.core.windows.WindowsPlatformThreads.osThreadStartRoutine(WindowsPlatformThreads.java:143)
        at com.oracle.svm.core.code.IsolateEnterStub.WindowsPlatformThreads_osThreadStartRoutine_77cb625316abfaaa1a6261614dc5eb03b33d1f85(generated:0)

        at com.oracle.graal.pointsto.constraints.UnsupportedFeatures.report(UnsupportedFeatures.java:129)
        at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:751)
        ... 6 more

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 or ver

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 or gradlew --version)

Apache Maven 3.8.4

Additional information

No response

@Cobas91 Cobas91 added the kind/bug Something isn't working label Jul 20, 2022
@quarkus-bot quarkus-bot bot added area/security env/windows Impacts Windows machines labels Jul 20, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Jul 20, 2022

/cc @sberyozkin

@sberyozkin
Copy link
Member

@Cobas91 I don't think it is a Quarkus bug, as the problem is reported in com.sap.conn.rfc.engine.GUID.

@zakkak Do you agree ?

@sberyozkin
Copy link
Member

@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

@zakkak
Copy link
Contributor

zakkak commented Jul 20, 2022

@zakkak Do you agree ?

I agree, this is not a Quarkus issue. the com.sap.conn.* packages seem to be causing the issues and they are not supported by Quarkus AFAIK.

@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.

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)).

@sberyozkin
Copy link
Member

@zakkak Hi, that tutorial you have added is very good, I'd just link to it from the Quarkus docs

@Cobas91
Copy link
Author

Cobas91 commented Jul 20, 2022

@sberyozkin @zakkak Thank you guys for the fast response. I will check out the links and docs.
Hopefully i can handle that error my own. This libary is the core of the complete Application. God bless i will find a solution!
Thx guys!

@sberyozkin
Copy link
Member

@Cobas91 Np, I'll close this issue with a doc update linking to @zakkak 's tutorial

@Cobas91
Copy link
Author

Cobas91 commented Jul 21, 2022

Small Update:
I fixed the "error" by this build argument
"--initialize-at-run-time=com.sap"

@quarkus-bot quarkus-bot bot added this to the 2.12 - main milestone Aug 4, 2022
@gsmet gsmet modified the milestones: 2.12.0.CR1, 2.11.3.Final Aug 23, 2022
gsmet added a commit to gsmet/quarkus that referenced this issue Aug 23, 2022
miador pushed a commit to miador/quarkus that referenced this issue Sep 6, 2022
@gkfirst8
Copy link

gkfirst8 commented May 9, 2023

To add this to a maven build you can configure the parameter "--initialize-at-run-time" using the "-Dquarkus.native.additional-build-args="--initialize-at-run-time=com.sap" or put it in the application.properties. (See https://quarkus.io/guides/building-native-image)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/security env/windows Impacts Windows machines kind/bug Something isn't working
Projects
None yet
5 participants