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

Cannot run minimal (GraalVM native images) samples #198

Closed
Azbesciak opened this issue Apr 13, 2019 · 4 comments
Closed

Cannot run minimal (GraalVM native images) samples #198

Azbesciak opened this issue Apr 13, 2019 · 4 comments
Labels
status: duplicate A duplicate of another issue type: bug A general bug

Comments

@Azbesciak
Copy link

Hello,
First of all I would like to really appreciate your work. Thank you!
I wanted to try native images, inspired by @sdeleuze presentation at Devoxx.
However, I faced an issue with running already built image (kofu-reactive-minimal) with error:

Exception in thread "main" java.util.NoSuchElementException: No attribute named 'value' present in merged annotation org.springframework.core.annotation.Order
        at org.springframework.core.annotation.AbstractMergedAnnotation.getRequiredAttributeValue(AbstractMergedAnnotation.java:198)
        at org.springframework.core.annotation.AbstractMergedAnnotation.getInt(AbstractMergedAnnotation.java:90)
        at org.springframework.core.annotation.OrderUtils.findOrder(OrderUtils.java:113)
        at org.springframework.core.annotation.OrderUtils.getOrderFromAnnotations(OrderUtils.java:104)
        at org.springframework.core.annotation.AnnotationAwareOrderComparator.findOrderFromAnnotation(AnnotationAwareOrderComparator.java:75)
        at org.springframework.core.annotation.AnnotationAwareOrderComparator.findOrder(AnnotationAwareOrderComparator.java:68)
        at org.springframework.core.OrderComparator.getOrder(OrderComparator.java:124)
        at org.springframework.core.OrderComparator.getOrder(OrderComparator.java:112)
        at org.springframework.core.OrderComparator.doCompare(OrderComparator.java:82)
        at org.springframework.core.OrderComparator.compare(OrderComparator.java:68)
        at java.util.TimSort.countRunAndMakeAscending(TimSort.java:355)
        at java.util.TimSort.sort(TimSort.java:220)
        at java.util.Arrays.sort(Arrays.java:1512)
        at java.util.ArrayList.sort(ArrayList.java:1462)
        at org.springframework.core.annotation.AnnotationAwareOrderComparator.sort(AnnotationAwareOrderComparator.java:111)
        at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:438)
        at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:427)
        at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:273)
        at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:252)
        at org.springframework.fu.kofu.KofuApplication$run$app$1.<init>(KofuApplication.kt:26)
        at org.springframework.fu.kofu.KofuApplication.run(KofuApplication.kt:26)
        at org.springframework.fu.kofu.KofuApplication.run$default(KofuApplication.kt:25)
        at com.sample.ApplicationKt.main(Application.kt:39)
        at com.sample.ApplicationKt.main(Application.kt)

Same applies to jafu-reactive-minimal. Currently I am using GraalVM RC 15 EE on Ubuntu 18.04, but had the same error with GraalVM CE. Also, I did not found any note at README, so I assume it is just enough to run ./build.sh and then start an image.

@sdeleuze
Copy link
Collaborator

Good catch, I have created oracle/graal#1170 about that issue.

@Sineaggi
Copy link

GraalVM RC 15 CE also has fixed this issue, however this exception now occurs at runtime.

Exception in thread "main" com.oracle.svm.core.jdk.UnsupportedFeatureError: Unsupported method java.lang.Class.getConstantPool() is reachable: The declaring class of this element has been substituted, but this element is not present in the substitution class
	at com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:102)
	at java.lang.Class.getConstantPool(DynamicHub.java)
	at java.lang.System$2.getConstantPool(System.java:1227)
	at java.lang.reflect.Method.getDefaultValue(Method.java:609)
	at org.springframework.core.annotation.AttributeMethods.<init>(AttributeMethods.java:73)
	at org.springframework.core.annotation.AttributeMethods.compute(AttributeMethods.java:273)
	at java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:324)
	at org.springframework.core.annotation.AttributeMethods.forAnnotationType(AttributeMethods.java:255)
	at org.springframework.core.annotation.AnnotationsScanner.getDeclaredAnnotations(AnnotationsScanner.java:445)
	at org.springframework.core.annotation.AnnotationsScanner.getDeclaredAnnotations(AnnotationsScanner.java:417)
	at org.springframework.core.annotation.AnnotationsScanner.processClassHierarchy(AnnotationsScanner.java:197)
	at org.springframework.core.annotation.AnnotationsScanner.processClass(AnnotationsScanner.java:127)
	at org.springframework.core.annotation.AnnotationsScanner.process(AnnotationsScanner.java:106)
	at org.springframework.core.annotation.AnnotationsScanner.scan(AnnotationsScanner.java:96)
	at org.springframework.core.annotation.AnnotationsScanner.scan(AnnotationsScanner.java:77)
	at org.springframework.core.annotation.TypeMappedAnnotations.scan(TypeMappedAnnotations.java:241)
	at org.springframework.core.annotation.TypeMappedAnnotations.get(TypeMappedAnnotations.java:148)
	at org.springframework.core.annotation.TypeMappedAnnotations.get(TypeMappedAnnotations.java:130)
	at org.springframework.core.annotation.OrderUtils.findOrder(OrderUtils.java:111)
	at org.springframework.core.annotation.OrderUtils.getOrderFromAnnotations(OrderUtils.java:104)
	at org.springframework.core.annotation.AnnotationAwareOrderComparator.findOrderFromAnnotation(AnnotationAwareOrderComparator.java:75)
	at org.springframework.core.annotation.AnnotationAwareOrderComparator.findOrder(AnnotationAwareOrderComparator.java:68)
	at org.springframework.core.OrderComparator.getOrder(OrderComparator.java:124)
	at org.springframework.core.OrderComparator.getOrder(OrderComparator.java:112)
	at org.springframework.core.OrderComparator.doCompare(OrderComparator.java:81)
	at org.springframework.core.OrderComparator.compare(OrderComparator.java:68)
	at java.util.TimSort.binarySort(TimSort.java:296)
	at java.util.TimSort.sort(TimSort.java:221)
	at java.util.Arrays.sort(Arrays.java:1512)
	at java.util.ArrayList.sort(ArrayList.java:1462)
	at org.springframework.core.annotation.AnnotationAwareOrderComparator.sort(AnnotationAwareOrderComparator.java:111)
	at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:438)
	at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:427)
	at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:273)
	at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:252)
	at org.springframework.fu.kofu.KofuApplication$run$app$1.<init>(KofuApplication.kt:26)
	at org.springframework.fu.kofu.KofuApplication.run(KofuApplication.kt:26)
	at org.springframework.fu.kofu.KofuApplication.run$default(KofuApplication.kt:25)
	at com.sample.ApplicationKt.main(Application.kt:124)
	at com.sample.ApplicationKt.main(Application.kt)

This looks to be related to oracle/graal#649

@sdeleuze
Copy link
Collaborator

sdeleuze commented Apr 24, 2019

I think we need to wait GraalVM 1.0 RC17 to have all the Spring related fixes.

@sdeleuze
Copy link
Collaborator

I am closing this issue in favor of #146 that will leverage the improvements of the related spring-projects/spring-framework#22968 Spring Framework issue for out of the box support.

sdeleuze added a commit that referenced this issue May 14, 2019
The focus is now on supporting GraalVM native image out of the box,
see #146 and spring-projects/spring-framework#22968 for more details.

Closes #198
@sdeleuze sdeleuze added status: duplicate A duplicate of another issue type: bug A general bug labels Jan 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate A duplicate of another issue type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants