We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
走向自动装配章节,FormatterAutoConfiguration会出现比JacksonAutoConfiguration提前被初始化的情况,也就是说在FormatterAutoConfiguration初始化的时候,ObjectMapper还没有被初始化,会导致如下条件永远成立 @bean @ConditionalOnClass(name = "com.fasterxml.jackson.databind.ObjectMapper") @ConditionalOnMissingBean(type = "com.fasterxml.jackson.databind.ObjectMapper") public Formatter jsonFormatter() { return new JsonFormatter(); } 在个人测试过程中是这样,望小马哥解答。自动配置的顺序是如何控制的?
The text was updated successfully, but these errors were encountered:
不同的操作系统可能存在加载 Class 的时机不同,如果你想绝对的控制的话,那么增加 @AutoConfigureBefore 或 @AutoConfigureAfter
@AutoConfigureBefore
@AutoConfigureAfter
Sorry, something went wrong.
mercyblitz
No branches or pull requests
走向自动装配章节,FormatterAutoConfiguration会出现比JacksonAutoConfiguration提前被初始化的情况,也就是说在FormatterAutoConfiguration初始化的时候,ObjectMapper还没有被初始化,会导致如下条件永远成立
@bean
@ConditionalOnClass(name = "com.fasterxml.jackson.databind.ObjectMapper")
@ConditionalOnMissingBean(type = "com.fasterxml.jackson.databind.ObjectMapper")
public Formatter jsonFormatter() {
return new JsonFormatter();
}
在个人测试过程中是这样,望小马哥解答。自动配置的顺序是如何控制的?
The text was updated successfully, but these errors were encountered: