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 image fails for Hibernate Validator (Graal 19) #2563

Closed
dmlloyd opened this issue May 22, 2019 · 2 comments · Fixed by #2875
Closed

Native image fails for Hibernate Validator (Graal 19) #2563

dmlloyd opened this issue May 22, 2019 · 2 comments · Fixed by #2875
Milestone

Comments

@dmlloyd
Copy link
Member

dmlloyd commented May 22, 2019

[INFO] [io.quarkus.creator.phase.nativeimage.NativeImagePhase] /home/david/local/jdk/graalvm-ce-19.0.0/bin/native-image -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -H:+ReportExceptionStackTraces -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime --initialize-at-build-time= -jar quarkus-integration-test-hibernate-validator-999-SNAPSHOT-runner.jar -J-Djava.util.concurrent.ForkJoinPool.common.parallelism=1 -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -H:+PrintAnalysisCallTree -H:-AddAllCharsets -H:EnableURLProtocols=http -H:NativeLinkerOption=-no-pie -H:-SpawnIsolates -H:-JNI --no-server -H:-UseServiceLoaderFeature -H:+StackTrace
[quarkus-integration-test-hibernate-validator-999-SNAPSHOT-runner:3037]    classlist:   4,227.60 ms
[quarkus-integration-test-hibernate-validator-999-SNAPSHOT-runner:3037]        (cap):   1,025.14 ms
[quarkus-integration-test-hibernate-validator-999-SNAPSHOT-runner:3037]        setup:   2,277.93 ms
java.lang.ClassNotFoundException: com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at io.quarkus.runner.AutoFeature.registerClass9(Unknown Source)
	at io.quarkus.runner.AutoFeature.beforeAnalysis(Unknown Source)
	at com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$7(NativeImageGenerator.java:667)
	at com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:64)
	at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:667)
	at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:523)
	at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:441)
	at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
java.lang.ClassNotFoundException: com.fasterxml.jackson.databind.ser.std.SqlDateSerializer
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at io.quarkus.runner.AutoFeature.registerClass10(Unknown Source)
	at io.quarkus.runner.AutoFeature.beforeAnalysis(Unknown Source)
	at com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$7(NativeImageGenerator.java:667)
	at com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:64)
	at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:667)
	at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:523)
	at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:441)
	at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
11:45:47,990 INFO  [org.hib.val.int.uti.Version] HV000001: Hibernate Validator 6.1.0.Alpha4
11:45:49,059 INFO  [org.jbo.threads] JBoss Threads version 3.0.0.Beta4
11:45:49,484 INFO  [org.xnio] XNIO version 3.7.1.Final
11:45:49,531 INFO  [org.xni.nio] XNIO NIO Implementation Version 3.7.1.Final
Warning: RecomputeFieldValue.FieldOffset automatic substitution failed. The automatic substitution registration was attempted because a call to sun.misc.Unsafe.objectFieldOffset(Field) was detected in the static initializer of org.jboss.threads.ThreadLocalResettingRunnable$Resetter. Detailed failure reason(s): The argument of Unsafe.objectFieldOffset(Field) is not a constant field., Could not determine the field where the value produced by the call to sun.misc.Unsafe.objectFieldOffset(Field) for the field offset computation is stored. The call is not directly followed by a field store or by a sign extend node followed directly by a field store. 
Warning: RecomputeFieldValue.FieldOffset automatic substitution failed. The automatic substitution registration was attempted because a call to sun.misc.Unsafe.objectFieldOffset(Field) was detected in the static initializer of org.jboss.threads.ThreadLocalResettingRunnable$Resetter. Detailed failure reason(s): The argument of Unsafe.objectFieldOffset(Field) is not a constant field., Could not determine the field where the value produced by the call to sun.misc.Unsafe.objectFieldOffset(Field) for the field offset computation is stored. The call is not directly followed by a field store or by a sign extend node followed directly by a field store. 
[quarkus-integration-test-hibernate-validator-999-SNAPSHOT-runner:3037]   (typeflow):  13,823.69 ms
[quarkus-integration-test-hibernate-validator-999-SNAPSHOT-runner:3037]    (objects):  14,861.74 ms
[quarkus-integration-test-hibernate-validator-999-SNAPSHOT-runner:3037]   (features):     665.15 ms
[quarkus-integration-test-hibernate-validator-999-SNAPSHOT-runner:3037]     analysis:  30,114.23 ms
Printing call tree to /home/david/src/java/quarkus/integration-tests/hibernate-validator/target/reports/call_tree_quarkus-integration-test-hibernate-validator-999-SNAPSHOT-runner_20190522_114620.txt
Printing list of used classes to /home/david/src/java/quarkus/integration-tests/hibernate-validator/target/reports/used_classes_quarkus-integration-test-hibernate-validator-999-SNAPSHOT-runner_20190522_114622.txt
Printing list of used packages to /home/david/src/java/quarkus/integration-tests/hibernate-validator/target/reports/used_packages_quarkus-integration-test-hibernate-validator-999-SNAPSHOT-runner_20190522_114622.txt
[quarkus-integration-test-hibernate-validator-999-SNAPSHOT-runner:3037]     (clinit):     578.99 ms
[quarkus-integration-test-hibernate-validator-999-SNAPSHOT-runner:3037]     universe:   1,462.22 ms
Fatal error: java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Cannot create java.lang.reflect.Method for class initializer
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:593)
	at java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:1005)
	at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:458)
	at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:289)
	at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:427)
	at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:109)
Caused by: java.lang.IllegalArgumentException: Cannot create java.lang.reflect.Method for class initializer
	at jdk.vm.ci.hotspot.CompilerToVM.asReflectionExecutable(Native Method)
	at jdk.vm.ci.hotspot.HotSpotJDKReflection.getMethod(HotSpotJDKReflection.java:446)
	at jdk.vm.ci.hotspot.HotSpotJDKReflection.getMethodAnnotation(HotSpotJDKReflection.java:175)
	at jdk.vm.ci.hotspot.HotSpotResolvedJavaMethodImpl.getAnnotation(HotSpotResolvedJavaMethodImpl.java:540)
	at org.graalvm.util.GuardedAnnotationAccess.getAnnotation(GuardedAnnotationAccess.java:52)
	at org.graalvm.util.GuardedAnnotationAccess.isAnnotationPresent(GuardedAnnotationAccess.java:47)
	at com.oracle.svm.hosted.cenum.CEnumCallWrapperSubstitutionProcessor.lookup(CEnumCallWrapperSubstitutionProcessor.java:54)
	at com.oracle.graal.pointsto.infrastructure.SubstitutionProcessor$ChainedSubstitutionProcessor.lookup(SubstitutionProcessor.java:128)
	at com.oracle.graal.pointsto.infrastructure.SubstitutionProcessor$ChainedSubstitutionProcessor.lookup(SubstitutionProcessor.java:128)
	at com.oracle.graal.pointsto.infrastructure.SubstitutionProcessor$ChainedSubstitutionProcessor.lookup(SubstitutionProcessor.java:128)
	at com.oracle.graal.pointsto.infrastructure.SubstitutionProcessor$ChainedSubstitutionProcessor.lookup(SubstitutionProcessor.java:128)
	at com.oracle.graal.pointsto.infrastructure.SubstitutionProcessor$ChainedSubstitutionProcessor.lookup(SubstitutionProcessor.java:128)
	at com.oracle.graal.pointsto.meta.AnalysisUniverse.lookupAllowUnresolved(AnalysisUniverse.java:396)
	at com.oracle.graal.pointsto.meta.AnalysisUniverse.lookup(AnalysisUniverse.java:376)
	at com.oracle.graal.pointsto.meta.AnalysisType.getClassInitializer(AnalysisType.java:962)
	at com.oracle.svm.hosted.classinitialization.TypeInitializerGraph.shouldPromoteToUnsafe(TypeInitializerGraph.java:196)
	at com.oracle.svm.hosted.classinitialization.TypeInitializerGraph.lambda$updateTypeInitializerSafety$3(TypeInitializerGraph.java:134)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174)
	at java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1556)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
	at com.oracle.svm.hosted.classinitialization.TypeInitializerGraph.updateTypeInitializerSafety(TypeInitializerGraph.java:134)
	at com.oracle.svm.hosted.classinitialization.TypeInitializerGraph.computeInitializerSafety(TypeInitializerGraph.java:113)
	at com.oracle.svm.hosted.classinitialization.ClassInitializationFeature.beforeCompilation(ClassInitializationFeature.java:215)
	at com.oracle.svm.hosted.NativeImageGenerator.lambda$doRun$2(NativeImageGenerator.java:572)
	at com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:64)
	at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:572)
	at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:441)
	at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Error: Image build request failed with exit status 1
@dmlloyd
Copy link
Member Author

dmlloyd commented May 22, 2019

See also oracle/graal#1320

@dmlloyd
Copy link
Member Author

dmlloyd commented May 28, 2019

Fixed in graalvm/graal-jvmci-8@2749403 but it will be a bit of time before it gets to a release, according to Christian Wimmer.

@dmlloyd dmlloyd closed this as completed May 28, 2019
@emmanuelbernard emmanuelbernard added this to the 0.18.0 milestone Jun 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants