I'm getting an "Unable to register MBean" error when enabling JMX service.
This is my persistence.xml file:
Code:
<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"/>
Code:
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:
Code:
org.springframework.orm.hibernate3.HibernateSystemException: Unable to register MBean [ON=org.hibernate.core:sessionFactory=null,serviceRole=org.hibernate.engine.jdbc.batch.spi.BatchBuilder,serviceType=org.hibernate.engine.jdbc.batch.internal.BatchBuilderImpl]; nested exception is org.hibernate.HibernateException: Unable to register MBean [ON=org.hibernate.core:sessionFactory=null,serviceRole=org.hibernate.engine.jdbc.batch.spi.BatchBuilder,serviceType=org.hibernate.engine.jdbc.batch.internal.BatchBuilderImpl]
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:690)
at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:104)
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:403)
at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:58)15:26:43.0496 [main] WARN TestEnvironment - setupHostCapacities() - Maximum elapsed time (2000 ms) reached.
at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:163)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
at gnet.server.app.shared.dao.HostCapacityDao$$EnhancerByCGLIB$$4cfa8652.merge(<generated>)
at gnet.server.gameapp.TestEnvironment.setupHostCapacity(TestEnvironment.java:181)
at gnet.server.gameapp.TestEnvironment.setupHostCapacities(TestEnvironment.java:61)
at gnet.server.gameapp.TestEnvironment$$FastClassByCGLIB$$d063166f.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)
at gnet.server.framework.aop.PerformanceMonitorInterceptor.aroundMethodExecution(PerformanceMonitorInterceptor.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:55)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
at gnet.server.gameapp.TestEnvironment$$EnhancerByCGLIB$$d5d4bdfc.setupHostCapacities(<generated>)
at gnet.server.gameapp.GamingNetworkApp.start(GamingNetworkApp.java:89)
at gnet.server.gameapp.GamingNetworkApp.main(GamingNetworkApp.java:140)
Caused by: org.hibernate.HibernateException: Unable to register MBean [ON=org.hibernate.core:sessionFactory=null,serviceRole=org.hibernate.engine.jdbc.batch.spi.BatchBuilder,serviceType=org.hibernate.engine.jdbc.batch.internal.BatchBuilderImpl]
at org.hibernate.service.jmx.internal.JmxServiceImpl.registerMBean(JmxServiceImpl.java:168)
at org.hibernate.service.jmx.internal.JmxServiceImpl.registerService(JmxServiceImpl.java:142)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.startService(AbstractServiceRegistryImpl.java:258)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:162)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.batchBuilder(JdbcCoordinatorImpl.java:106)
at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.getBatch(JdbcCoordinatorImpl.java:155)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2967)
at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2918)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:3247)
at org.hibernate.action.internal.EntityUpdateAction.execute(EntityUpdateAction.java:140)
at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:362)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:354)
at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:276)
at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:326)
at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:52)
at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1214)
at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:986)
at sun.reflect.GeneratedMethodAccessor70.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:240)
at $Proxy58.flush(Unknown Source)
at gnet.server.framework.dao.AbstractGenericJpaDao.merge(AbstractGenericJpaDao.java:92)
at gnet.server.framework.dao.GenericJpaDao.merge(GenericJpaDao.java:27)
at gnet.server.framework.dao.GenericJpaDao$$FastClassByCGLIB$$587ab5ef.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)
... 33 more
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