You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DefaultParameterNameDiscoverer should automatically adapt to Graal constraints [SPR-17005] #21543
ParameterNameDiscoverer is used in a number of places in Spring, not least of which is in the core DI features. AbstractAutowireCapableBeanFactory exposes a setter and a getter, but it's not available in any public interfaces that are easy to access, so it seems like you have to resort to downcasting:
MVC and Webflux also use parameter name discovery for controller methods. This can be avoided if users explicitly add annotations, or simply don't use the flexible method signature features.
The default parameter name discoverer uses reflection and also ASM, and both of these strategies is problematic or unavailable in native images (c.f. GraalVM). It seems like the AbstractAutowireCapableBeanFactory actually works fine with a NoopParameterNameDiscoverer (that just returns null), unless it has to do autowire by name (which is pretty uncommon I should think).
Resolved by using no ParameterNameDiscoverer with Graal native images via org.graalvm.nativeimage.imagecode system property (which is considered as a public API) as advised by GraalVM team, see ImageInfo.java.
Activity
spring-projects-issues commentedon Jul 18, 2018
Sébastien Deleuze commented
Resolved by using no
ParameterNameDiscovererwith Graal native images viaorg.graalvm.nativeimage.imagecodesystem property (which is considered as a public API) as advised by GraalVM team, see ImageInfo.java.