简体   繁体   中英

JMX from Spring @ Tomcat using Java based Config

I like to see the hibernate statistics but cant find them.

Where do i have to search?

@Bean
@Lazy
public MBeanExporter getExporter() {
    MBeanExporter exporter = new MBeanExporter();
    exporter.setServer(mBeanFactory());
    exporter.setRegistrationBehavior(MBeanExporter.REGISTRATION_REPLACE_EXISTING);
    HashMap beans = new HashMap();
    beans.put("hibernate:name=statistics", hibernateStatistics());
    exporter.setBeans(beans);
    return exporter;
}

在此处输入图片说明

Ok, the jmxbean should be on root.

I had do mark the hibernateStatistics()-Bean to be @DependsOn("hibernate").

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM