spring-bootjmxspring-jmx

Spring Boot 2.3.1: managed beans missing


I updated from Spring Boot 2.2.6.RELEASE to 2.3.1.RELEASE and suddenly, all my @ManagedResources beans are missing in the JMX console and even all from Spring Boot itself. However, all jolokia, java.lang, java.nio, org.apache.activemq and org.apache.logging.log4j2 are there.

Interestingly, this only happens when the application is installed on the server. When I run it from IntelliJ, all managed beans are there.

So I'm suspecting some issue in the order in which the beans are loaded but I really have no idea where to start looking. Has anyone experienced something like this?

This is my Application class:

@SpringBootApplication(
  scanBasePackageClasses = {
    // Some shared @Component in a common module
    com.example.convert.Import.class,
    com.example.config.Import.class,
    DispatcherApplication.class
  },
  // Since there are two datasources, they need to be configured manually
  exclude = {DataSourceAutoConfiguration.class, JdbcRepositoriesAutoConfiguration.class}
)
@EnableScheduling
@EnableIntegrationGraphController
@EnableIntegrationManagement
@EnableMapRepositories(includeFilters = {@ComponentScan.Filter(type = FilterType.REGEX, pattern = ".+\\.map\\..+")})
@EnableIntegration
@EnableJms
@EnableRetry
@EnableConfigurationProperties(DispatcherProperties.class)
public class DispatcherApplication {

  public static void main(String[] args) {
    SpringApplication.run(DispatcherApplication.class, args);
  }
}

Somewhere (can't find it right now) someone had a problem that the component-scan was done after/before some JMX configuration but so far, I've not customized any JMX behavior.


Solution

  • It turned out that I actually updated from 2.1.2.RELEASE to 2.2.6.RELEASE and then to 2.3.1.RELEASE on the same day and JMX is disabled since 2.2.0.M1 (see also: Spring Boot 2.2 Release Notes.

    Therefore, spring.jmx.enabled=true is now required, which was set by IntelliJ's run configuration.