Q:

running Hibernate 4.3 with JMX (without spring)

I'm running a java webapp (wicket 6.13) using Hibernate 4.3 and Guice 1.0
I'm trying to configure Hibernate so that I can access runtime information via the JMX framework.
I'm not using spring, can anyone indicate how I enable the JMX on hibernate 4.3 manually.
I've poked around the JmxService, JmxServiceInitiator, JmxServiceImpl, StandardServiceRegistryImpl 
I've also found the following settings in AvailableSettings: 
"hibernate.jmx.enabled";
"hibernate.jmx.usePlatformServer";
"hibernate.jmx.agentId";
"hibernate.jmx.defaultDomain";
"hibernate.jmx.sessionFactoryName";

I've added the jmx.enabled true setting to my hibernate.cfg.xml file but this has had no effect.
I'm still not sure how to go about this.
Any help much appreciated

A:

seems to be a bug after refactoring in hibernate.
see https://hibernate.atlassian.net/browse/HHH-6190 for details
Here's a workaround I've used, utilising a java dynamic proxy to represent the statistics interface from hibernate, and the default platform mbean server:
@MXBean
public interface StatisticsMXBean extends Statistics {
}

public void initStatistics(SessionFactory sessionFactory) {
    ObjectName statsName = new ObjectName("org.hibernate:type=statistics");
    MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer();

    final Statistics statistics = sessionFactory.getStatistics();
    statistics.setStatisticsEnabled(true);
    Object statisticsMBean = Proxy.newProxyInstance(getClass().getClassLoader(), new Class<?>[] { StatisticsMXBean.class }, new InvocationHandler() {

            @Override
            public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
                return method.invoke(statistics, args);
            }
        });

    mbeanServer.registerMBean(statisticsMBean, statsName);
}

