在jconsole中没有设置hibernate环境

时间:2015-03-27 05:52:14

标签: java hibernate jboss jconsole jvisualvm

我使用hibernate-jconsole-1.0.7.jar来监控hibernate。但是每当我运行jar时,Jconsole都会以exception开头。这是Jconsole输出

javax.management.InstanceNotFoundException: Hibernate:application=Statistics is not registered.
    at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:523)
    at org.jboss.mx.server.MBeanServerImpl.getAttributes(MBeanServerImpl.java:562)
    at javax.management.remote.rmi.RMIConnectionImpl.doOperation(Unknown Source)
    at javax.management.remote.rmi.RMIConnectionImpl.access$300(Unknown Source)
    at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(Unknown Source)
    at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(Unknown Source)
    at javax.management.remote.rmi.RMIConnectionImpl.getAttributes(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor279.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
    at sun.rmi.transport.Transport$2.run(Unknown Source)
    at sun.rmi.transport.Transport$2.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Unknown Source)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.access$400(Unknown Source)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(Unknown Source)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:275)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:252)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:161)
    at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source)
    at javax.management.remote.rmi.RMIConnectionImpl_Stub.getAttributes(Unknown Source)
    at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.getAttributes(RMIConnector.java:931)
    at net.sf.hibernate.jconsole.hibernate.HibernateContext.getAttributes(HibernateContext.java:199)
    at net.sf.hibernate.jconsole.AbstractStatisticsContext.refreshAttributes(AbstractStatisticsContext.java:194)
    at net.sf.hibernate.jconsole.AbstractStatisticsContext.refresh(AbstractStatisticsContext.java:170)
    at net.sf.hibernate.jconsole.HibernateJConsolePlugin$Updater.doInBackground(HibernateJConsolePlugin.java:50)
    at javax.swing.SwingWorker$1.call(SwingWorker.java:296)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at javax.swing.SwingWorker.run(SwingWorker.java:335)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

我确实发布了Hibernate:application=Statistics bean,我可以看到bean中的jboss jmxconsole
我也将hibernte3.jar添加到jconsole classpath。我使用jdk 1.7和jboss 4.2.3 GA。

非常感谢任何帮助。

0 个答案:

没有答案