When running https://github.com/spring-projects/spring-aot-smoke-tests/tree/main/actuator-webmvc on the JVM, http://localhost:8080/actuator/loggers is accessible. On native, it is not and returns a 404.
Comment From: wilkinsona
I see the same problem on the JVM with AOT enabled. Looking at the generated code, there's no definition for the loggersEndpoint bean:
package org.springframework.boot.actuate.autoconfigure.logging;
import java.lang.Class;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.RootBeanDefinition;
/**
* Bean definitions for {@link LoggersEndpointAutoConfiguration}
*/
public class LoggersEndpointAutoConfiguration__BeanDefinitions {
/**
* Get the bean definition for 'loggersEndpointAutoConfiguration'
*/
public static BeanDefinition getLoggersEndpointAutoConfigurationBeanDefinition() {
Class<?> beanType = LoggersEndpointAutoConfiguration.class;
RootBeanDefinition beanDefinition = new RootBeanDefinition(beanType);
beanDefinition.setInstanceSupplier(LoggersEndpointAutoConfiguration::new);
return beanDefinition;
}
}
It looks like the conditions didn't match when evaluated at build time. I suspect it's because the LoggingSystem bean is missing.
Comment From: wilkinsona
The LoggingSystem bean should be registered at the end of SpringApplication's preparation of the context via the ApplicationPreparedEvent that's published due to the contextLoaded call to the run listeners. However, the ApplicationPreparedEvent is never published as the AOT processing hook's run listener is called before EventPublishingRunListener and it throws an AbandonedRunException.
Comment From: wilkinsona
Closed by 26eff5ae7ad3c4ed0d253bb5feed66dc90afa0b4.