Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6696970

Jconsole becomes unusable if a plugin throws an exception

XMLWordPrintable

    • b105
    • x86
    • linux

      FULL PRODUCT VERSION :
      Using
      JConsole version: 1.6.0_03-b05
      Java VM version: Java HotSpot(TM) Client VM, 1.6.0_03-b05

      A DESCRIPTION OF THE PROBLEM :
      There is no problem using a readwrite role but when you set the role to readonly JConsole gives the error:

      Exception in thread "AWT-EventQueue-0" java.lang.SecurityException: Access denied! Invalid access level for requested MBeanServer operation.
      at com.sun.jmx.remote.security.MBeanServerFileAccessController.checkAccessLevel(Unknown Source)
      at com.sun.jmx.remote.security.MBeanServerFileAccessController.checkWrite(Unknown Source)
      at.....

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      setup a plain application on Java 5 or 6 with remote jmx and the 2 default roles controlRole and monitorRole then access with JConsole from Java 6. With controlRole no problems with monitorRole you get the error.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      expected to get access
      ACTUAL -
      denied access

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Exception in thread "AWT-EventQueue-0" java.lang.SecurityException: Access denied! Invalid access level for requested MBeanServer operation.
      at com.sun.jmx.remote.security.MBeanServerFileAccessController.checkAccessLevel(Unknown Source)
      at com.sun.jmx.remote.security.MBeanServerFileAccessController.checkWrite(Unknown Source)
      at com.sun.jmx.remote.security.MBeanServerAccessController.setAttribute(Unknown Source)
      at javax.management.remote.rmi.RMIConnectionImpl.doOperation(Unknown Source)
      at javax.management.remote.rmi.RMIConnectionImpl.access$200(Unknown Source)
      at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(Unknown Source)
      at javax.management.remote.rmi.RMIConnectionImpl.setAttribute(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.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$1.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.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(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:255)
      at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
      at com.sun.jmx.remote.internal.PRef.invoke(Unknown Source)
      at javax.management.remote.rmi.RMIConnectionImpl_Stub.setAttribute(Unknown Source)
      at javax.management.remote.rmi.RMIConnector$RemoteMBeanServerConnection.setAttribute(RMIConnector.java:921)
      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 sun.tools.jconsole.ProxyClient$SnapshotInvocationHandler.invoke(ProxyClient.java:982)
      at $Proxy0.setAttribute(Unknown Source)
      at com.sun.jmx.mbeanserver.MXBeanProxy$SetHandler.invoke(MXBeanProxy.java:120)
      at com.sun.jmx.mbeanserver.MXBeanProxy.invoke(MXBeanProxy.java:148)
      at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:248)
      at $Proxy2.setThreadCpuTimeEnabled(Unknown Source)
      at JTop.setMBeanServerConnection(JTop.java:126)
      at JTopPlugin.getTabs(JTopPlugin.java:82)
      at sun.tools.jconsole.VMPanel.createPluginTabs(VMPanel.java:640)
      at sun.tools.jconsole.VMPanel.propertyChange(VMPanel.java:314)
      at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
      at javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(SwingPropertyChangeSupport.java:75)
      at javax.swing.event.SwingPropertyChangeSupport$1.run(SwingPropertyChangeSupport.java:80)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      use Java 5 JConsole

            egahlin Erik Gahlin
            emcmanus Eamonn McManus
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: