-
Notifications
You must be signed in to change notification settings - Fork 1.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
Errors trying to create native image that uses groovy version 2.4.21 #4484
Comments
Hi, Thank you for reporting this we will take a look into it and get back to you |
I am seeing a similar error, this time with Groovy 4. Running with:
Produces:
|
Hi @mmoayyed, Could you please try with GraalVM 22.3.1 If that doesn't fix it, please provide a small reproducer to this issue that we can use to further investigate. |
@oubidar-Abderrahim Thanks much for the follow-up. Trying with 22.3.1 produces the same problem. Here is a hopefully-small reproducer: Instructions here should help you build and run the native app: |
@mmoayyed Can you try generating the Metadata configuration file using the Tracing agent with Let me know if that helps |
@oubidar-Abderrahim I also have the same issue. When I try using
Not sure if this is specific to my project or not |
@ctron-te, make sure your code is working on JIT mode first, and test as many use cases as possible during the generation of config files with the tracing agent. |
Any updates @ctron-te? |
@oubidar-Abderrahim, unfortunately, this is still not working. I'm running exactly the same codepath when tracing and when executing in native mode. |
If you can share a small reproducer, we can take a look into it |
That might be difficult in my case, how about the reproducer from @mmoayyed? |
I am working on it as I find the time; so far I have run into: spring-projects/spring-integration#8571 |
I use reflectasm to dynamically create class bytecode, but after using How can I solve it? com.oracle.svm.core.jdk.UnsupportedFeatureError: Defining a class from new bytecodes at run time is not supported. Class com.test.TestMethodAccess with hash 3eedbbac207f437b7c73e05ab3b081def254cb6d0d51f732c2a932200a77d84a was not provided during the image build. Please see BuildConfiguration.md.
at com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:89)
at com.oracle.svm.core.hub.PredefinedClassesSupport.loadClass(PredefinedClassesSupport.java:136)
at java.lang.ClassLoader.defineClass(ClassLoader.java:298)
at com.esotericsoftware.reflectasm.AccessClassLoader.defineClass(AccessClassLoader.java:179)
at com.esotericsoftware.reflectasm.AccessClassLoader.defineAccessClass(AccessClassLoader.java:144)
at com.esotericsoftware.reflectasm.MethodAccess.get(MethodAccess.java:311)
|
Using the following:
I have run into a new and yet similar issue:
The problem appears to be here: if (attributes) {
attributes.entrySet().each { entry ->
attributes[(entry.key)] = attributes[(entry.key)].toString()
}
} It looks as though the native-agent is unclear where Here is a hopefully-small reproducer: Instructions here should help you build and run the native app: |
I had the same problem with nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect 3.2.1 with id 'org.graalvm.buildtools.native' version '0.9.28'. I was fortunate to be able to skip this library which solved it. |
Updates:
agent {
defaultMode = "direct"
enabled = true
builtinCallerFilter = false
builtinHeuristicFilter = false
enableExperimentalPredefinedClasses = true // per the above suggestion
enableExperimentalUnsafeAllocationTracing = false
trackReflectionMetadata = false
modes {
standard {
}
direct {
options.add("config-output-dir={output_dir}")
options.add("experimental-configuration-with-origins")
}
}
} Also turned off the Error: same as before,
|
Hi @mmoayyed, I cannot find the example at https://github.com/mmoayyed/demo-spring-boot-native Can you please re-share it with the steps to reproduce? Thank you |
Any updates? |
No, sorry. I will be very busy for the next few weeks. Could we pause this for the time being please? I will get back to it at some point. Or, you're welcome to close and I can follow up later when/if I can reproduce this again. |
Thank you for your response, we've been working on improving our support on Github and resolving most of our backlog, we should be able to pick this up faster whenever you are ready to follow up on it. |
Describe the issue
I am having issues using the functionality from groovy version
2.4.21
. I am able to generate thereflect-config.json
using the trace agent, and I am able to generate the native image with thenative-image
but when using the native image, I am getting the next error:You can get the code I am using for testing from here: https://github.com/hectorhuol/test-graalvm-groovy
Steps to reproduce the issue
Please include both build steps as well as run steps
HelloWorld.java class
:javac -cp groovy-2.4.21.jar HelloWorld.java
java -agentlib:native-image-agent=config-output-dir=META-INF/native-image -cp .;groovy-2.4.21.jar HelloWorld
native-image --no-fallback --allow-incomplete-classpath --report-unsupported-elements-at-runtime --native-image-info --verbose -cp .;groovy-2.4.21.jar HelloWorld hello-world
hello-world.exe
Describe GraalVM and your environment:
More details
Here is the output when generating the native image:
Here is again the error I get when running the native image:
The text was updated successfully, but these errors were encountered: