-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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] [Buildtime] Getting a java.lang.NoClassDefFoundError: groovy/lang/GroovyObject when running a native-image #1731
Comments
Jar is available at #1711 (comment) in order to reproduce the issue |
I'll correct myself from earlier, this happens while trying to build the native-image, not when running it. |
@peter-hofer did the Jar work for you? Do you have any hints for me? Pls do let me know otherwise. |
@peter-hofer any update on this? |
Hi, As workaround, I tried to add Groovy as dep in my application's pom.xml, but didnt work. The error went away, but new ones arose. Those errors were solved by adding new deps in my pom, but this ended up in an endless process without a final solution. Code is on my company private repo, but will try to share if needed. Its just a simple SpringBoot(2.2)+SpringCloudConfig application. |
I get this error with the JAR from your download:
The
Thanks for commenting @nestis, another example would be very welcome. |
Thanks for looking at this @peter-hofer, I'll revisit the jar and update the link and let you know. I solved the issue in #1711 by passing in some parameters at runtime, which were specific to the app, which isn't GraalVM specific, but I have added that to the scripts I provided (AFAIK) - I'll recheck when I take a look again. You shouldn't get those errors you mentioned, as I didn't get them during my build. @nestis thanks for your input. |
This is my version of
|
I tried to build the native-image using the same jar I provided earlier and got the same error:
I'll still upload a new zip with everything you need in it. Instructions to use are the same as in the #1711 (comment) comment. Avoid using |
I have recompiled it with Please do use the |
I have one more question about the below:
But only applies if you are using my
I could be wrong but would be good to know if this is expected behaviour? I'm doing the below:
to assign |
Thanks for providing the new JAR. I'm using a current build of GraalVM and your configuration scripts. I'm now getting this, which seems to be caused by a potential reflective access to
That is to be expected: our design explicitly takes all the configuration files that it can find as input, rather than having them override each other in some way. The idea is that you can use a Java library in your project that brings its own native-image configuration files in its JAR instead of you having to provide those configuration files yourself. |
The build script doesn't seem to have picked up the
This is most likely caused by an instance of |
So the javacpp.jar library has been omitted with intention as it was clashing with the one with GraalVM (both my jar and GraalVM collided with this) - this issue might have been fixed by now by at that time I raised #1711 and was advised in the conversation #1711 (comment) to drop the library from GraalVM SDK when building the native-image. |
I actually don't get these errors I'll share what I get (for both Linux and MacOS) - perhaps one of our environments is interfering with building of the native-image, see https://gist.github.com/neomatrix369/9720802c2c3f6b5e6927b62c30a47187. I'll try to reproduce this in a clean isolated environment to see if the issue persists. |
I got rid of the errors from the log you posted ( |
Regardless, this issue seems to be caused by an incomplete classpath that doesn't include |
Okay I see, no actually I didn't use javacpp at all to attempt to build the native-image, although when I did use javacpp, starting 19.2.1 I didn't get any errors as I did previously. My observation so far has been that whether we leave javacpp in the path or not we don't get the previous error since 19.2.1 - not sure what has changed. |
Thanks again - great finding, I'll leave it to your side to work on it further. Do you need any more details from me or anything else to help with any further investigation or fixing of the issue? |
Should be fixed in 0fef136. |
On the back of issue #1711, although we have been able to overcome the reported error with work-around, we now get the below error when building the native-image:
I did have a look at #953 and #1306 but it does not appear to be these - are they related?
The text was updated successfully, but these errors were encountered: