-
Notifications
You must be signed in to change notification settings - Fork 353
AOT engine does not process Actuator child context #1146
Comments
The error occurs when a different management port is specified( I have followed the error messages and added this [
{
"name": "org.springframework.boot.actuate.endpoint.web.annotation.WebEndpointFilter",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"name": "org.springframework.context.annotation.ConfigurationClassPostProcessor",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
}
] However, it still complains at runtime:
It's strange asking Hope it helps to diagnose this issue. |
I just looked at the Spring Boot code and stacktrace more carefully and the root cause was there. When management port is different, Then, it creates a new application context via To make the issue bit more complicated, the management context registers This process seems too dynamic for native runtime. There are multiple ways to handle this issue. |
We don't support yet the child context for the actuator. We need to detect it, process the child context and generate the code like we do for the main context and then register a |
I've started looking into this and I've got a simple infrastructure that swaps the |
Making progress with additional refinements to support this use case: |
This commit adds support for the separate application context that Spring Boot creates when a management port is set. In AOT mode, the context is processed at build time, exactly as the maine one is, and the ManagementContextFactory implementation is replaced by an AOT-specific one that loads the context from the generated code. Closes spring-atticgh-1146
This commit adds support for the separate application context that Spring Boot creates when a management port is set. In AOT mode, the context is processed at build time, exactly as the maine one is, and the ManagementContextFactory implementation is replaced by an AOT-specific one that loads the context from the generated code. Closes spring-atticgh-1146
Alright, so this is basically implemented but we require a change in Spring Boot post RC for MVC, see spring-projects/spring-boot#28437. I'll park this until we can depend on |
In https://start.spring.io the very basic app was created (Gradle + Kotlin + Boot (2.6.0.M3) + Spring Reactive Web + Native + Actuator). Nothing was changed apart from adding single entry to
application.properties
(management.server.port=8081
).Docker image was build by
bootBuildImage
Gradle task.Result of running image (
docker run --rm -p 8081:8081 -e "debug=true" springbugreports/nativebugreport
) is following:I wonder why this happened because native hints should be properly set by:
https://github.com/spring-projects-experimental/spring-native/blob/3987298796423bdf3c1ded009990003826681968/spring-native-configuration/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/servlet/CommonWebActuatorTypes.java#L58
And it's directly visible in reflect-config.json which contains:
.zip file with project:
nativeBugReport.zip
The text was updated successfully, but these errors were encountered: