After an upgrade from 3.0.5 to 3.0.6 yesterday, our natively compiled applications are failing to start. Apparently the resource org.aspectj.weaver.weaver-messages is not included automatically anymore. After adding the resource explicitly with a ResourceHint, the startup gets beyond this point but has other issues later (will submit separate issue for that). Things worked perfectly fine without any special ResourceHint with 3.0.x up to 3.0.5. Using the Gradle plugin org.graalvm.buildtools.native - version 0.9.20 See attached stacktrace. stacktrace.txt

Comment From: matthenry87

In the meantime, you can configure the GraalVM native image to pick up the prior release version of the reachability metadata repository.

https://graalvm.github.io/native-build-tools/latest/maven-plugin.html#_configuring_the_metadata_repository

Version 0.2.6 is the prior version that may have previously been working for you. Alternatively, you can target specific hint versions for individual dependencies.

Comment From: lambliesdown

I haven't tried that yet, but I don't think that'll help. The aspectj library doesn't seem to be part of GraalVM's metadata repository.

Comment From: matthenry87

You need to tell the GraalVM compiler that it should include the file it's looking for at compile time. Create src/main/resources/META-INF/native-image/resource-config.json and inside :

{
    "resources":
    {
        "includes":
        [
            {
                "pattern": "\\Qorg/aspectj/weaver/weaver-messages.properties\\E"
            }
        ]
    }
}

That will likely get you past that error - but then potentially onto the next one. Nature of the game :) https://www.graalvm.org/22.0/reference-manual/native-image/Resources/

Same story for reflection, dynamic class loading, and proxies. Have to tell GraalVM native image compiler about them in advance.

I've become more familiar with the tracing agent - huge help. Run it once, and then use it's output to search for the hints - for the classes/files you get errors about, then pull the needed hint(s) into your own set.

Comment From: matthenry87

Then - you can also come more correct when reporting issue, with what hints you added to fix the problem - so the Spring Boot team can add them if needed.

On that note - a small bare-bones reproducer project will likely be asked of you if you want someone else to go through this stuff instead.

Comment From: wilkinsona

Spring Boot doesn't provide any hints for AspectJ so I'm not sure why this worked previously. Perhaps something else was providing the necessary hints either intentionally or through an accidentally too-broad pattern. A minimal example should help us to track down why this worked before so that we can identify the right place for a fix. Can you please provide one, @lambliesdown?

Comment From: lambliesdown

Just realized that my issue is pretty much the same as https://github.com/spring-projects/spring-boot/issues/35049. I wasn't able to strip down my project to an easily reproducible example. It just happened that the weaver-messages.properties was included in the AOT generated resource-config.json in my bigger project with lots of dependencies in Spring Boot 3.0.5. and now it isn't any more. I got things to work with the hints suggested in https://github.com/spring-projects/spring-boot/issues/35049. Closing this issue as duplicate.

Comment From: wilkinsona

Thanks for letting us know, @lambliesdown.