-
Notifications
You must be signed in to change notification settings - Fork 40.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
Failed to extract parameter names exception thrown when binding with non-enumerable property source #38201
Comments
The root cause of the problem is this change in Spring Framework: spring-projects/spring-framework#29559 When running the application with Spring Boot 3.1.5, you should see this warning:
It appears that json-path is not compiled with |
@jorgerod While we're considering this, can you provide an example of how you set the |
Exactly, In that simplified case, I could rename the getJsonPath method and there would be no problem. However, my real case is that my configuration properties extends another third party class where the
In my run I don't see that warning message. |
I confirm that I also don't see mentioned warning in the console. And if I add "-parameters" to Java compiler configuration then error is gone:
|
The presence of The above may also explain why the warning isn't shown with 3.1. To be shown, there needs to be a non-enumerable property source in the environment and there isn't one by default in 3.1 ( package com.example.sb3restwebmvc;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.env.PropertySource;
@SpringBootApplication
public class Sb3RestWebmvcApplication {
public static void main(String[] args) {
SpringApplication app = new SpringApplication(Sb3RestWebmvcApplication.class);
app.addInitializers((context) -> {
context.getEnvironment().getPropertySources().addLast(new PropertySource<String>("breakage") {
@Override
public Object getProperty(String name) {
return null;
}
});
});
app.run(args);
}
} This main class will also reproduce the failure in 3.2 without the |
Hi
I found a bug when testing version 3.2.0-RC2 when binding in a configuration properties.
My configuration properties:
Stacktrace:
Reviewing the problem in more detail, this error occurs when
LogCorrelationPropertySource
is in the context, otherwise, the operation is correct.spring-boot/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/tracing/LogCorrelationEnvironmentPostProcessor.java
Lines 36 to 49 in ab2c7d0
In Spring boot 3.1.5 it works fine.
I attach a small example to reproduce it.
sb3-rest-webmvc.zip
The text was updated successfully, but these errors were encountered: