Issue Type: Bug Bug
Affects Versions: 4.1.4
Assignee: Unassigned
Attachments: stacktrace.log
Components: core
Created: 22/Jun/12 1:46 PM
Description:

I'm getting an "Unable to register MBean" error when enabling JMX service.

This is my persistence.xml file:

<persistence-unit name="TournSpringJpaPersistenceUnit" transaction-type="RESOURCE_LOCAL">

<non-jta-data-source>tourn</non-jta-data-source>

<!-- Mapping jar/orm files -->
<mapping-file>META-INF/mysql/orm-tournament.xml</mapping-file>
<exclude-unlisted-classes>true</exclude-unlisted-classes>

<!-- A list of vendor-specific properties -->
<properties>
<property name="hibernate.archive.autodetection" value="class"/>
<property name="hibernate.max_fetch_depth" value="2"/>
<property name="hibernate.cache.use_second_level_cache" value="true"/>
<property name="hibernate.cache.use_query_cache" value="true"/>
<property name="hibernate.cache.use_minimal_puts" value="true"/>
<property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory"/>
<property name="net.sf.ehcache.configurationResourceName" value="META-INF/ehcache.xml"/>
<property name="hibernate.generate_statistics" value="true"/>
<property name="hibernate.jmx.enabled" value="true"/>
</properties>
</persistence-unit>

I tried to add hibernate.jmx.usePlatformServer but it didn't help
<property name="hibernate.jmx.usePlatformServer" value="true"/>

Caused by: javax.management.NotCompliantMBeanException: MBean class org.hibernate.engine.jdbc.batch.internal.BatchBuilderImpl does not implement DynamicMBean, neither follows the Standard MBean conventions (javax.management.NotCompliantMBeanException: Class org.hibernate.engine.jdbc.batch.internal.BatchBuilderImpl is not a JMX compliant Standard MBean) nor the MXBean conventions (javax.management.NotCompliantMBeanException: org.hibernate.engine.jdbc.batch.internal.BatchBuilderImpl: Class org.hibernate.engine.jdbc.batch.internal.BatchBuilderImpl is not a JMX compliant MXBean)
at com.sun.jmx.mbeanserver.Introspector.checkCompliance(Introspector.java:160)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:305)
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:482)
at org.hibernate.service.jmx.internal.JmxServiceImpl.registerMBean(JmxServiceImpl.java:161)
... 62 more

Full stackTrace attached.

Environment: spring 3.1.1, jpa2, hibernate4
Project: Hibernate ORM
Priority: Critical Critical
Reporter: Leonardo Pinho
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira