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
Runtime hint registration for property binding should not fail when parameter information is unavailable #40051
Comments
BindableRuntimeHintsRegistrar
more lenient when parameters lack of parameter informationBindableRuntimeHintsRegistrar
more lenient when there is a lack of parameter information
BindableRuntimeHintsRegistrar
more lenient when there is a lack of parameter information
Test that reproduces the problem: @Test
void registerHintsDoesNotThrowWhenParameterInformationForConstructorBindingIsNotAvailable()
throws NoSuchMethodException, SecurityException {
Constructor<?> constructor = PoolProperties.InterceptorProperty.class.getConstructor(String.class, String.class);
String[] parameterNames = new StandardReflectionParameterNameDiscoverer().getParameterNames(constructor);
assertThat(parameterNames).isNull();
assertThatNoException().isThrownBy(() -> registerHints(PoolProperties.class));
} |
I checked the commit that added Also, if you check the issue below, it seems that another error will occur if you do not throw |
The line which throws the exception has been added in #33182. If we remove the exception, the build works, but the application still doesn't work on native, because without |
@mhalbritter Can you share the failure? I'm not sure why we're trying to bind |
Oh sorry, that was not clearly phrased. I haven't tested it, just read through the history of #33182. Now that I've tested it, indeed the native image application works fine, even when using the So this looks like a false positive of the early failure detection introduced in #33182. |
Great, thank you. That's what I expected. I think this issue shows that the early failure detection is a bit too much as it may generate false positives. I think we should remove it. |
The chain it follows is: |
I have removed the exception. |
On Spring Petclinic during a native build or a JVM one with the AOT plugin enabled, if I change the
pom.xml
to usetomcat-jdbc
as following:I get the following exception while building the application:
Would be nice if the registrar would ignore failures due to a lack of parameter information.
Notice the application works fine without AOT involved.
The text was updated successfully, but these errors were encountered: