Bug 34078 - JConsole fails to run on GNU Classpath
JConsole fails to run on GNU Classpath
Status: ASSIGNED
Product: classpath
Classification: Unclassified
Component: swing
unspecified
: P3 normal
: ---
Assigned To: Andrew John Hughes
:
Depends on: 34581 34576 34577 34580 34582
Blocks: 34277
  Show dependency treegraph
 
Reported: 2007-11-12 21:32 UTC by Andrew John Hughes
Modified: 2007-12-31 04:24 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-12-24 21:32:17


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew John Hughes 2007-11-12 21:32:19 UTC
cacao -jar ~/build/fake_jdk.icedtea/lib/jconsole.jar
Exception during event dispatch:
java.lang.IllegalArgumentException
   at java.awt.Container.addImpl(Container.java:322)
   at java.awt.Container.add(Container.java:295)
   at javax.swing.JFrame.addImpl(JFrame.java:262)
   at java.awt.Container.add(Container.java:278)
   at javax.swing.JFrame.setRootPane(JFrame.java:229)
   at sun.tools.jconsole.JConsole.<init>(JConsole.java:117)
   at sun.tools.jconsole.JConsole$6.run(JConsole.java:788)
   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:200)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:615)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:88)
   at java.lang.VMThread.run(VMThread.java:120)
Comment 1 Andrew John Hughes 2007-11-12 21:33:47 UTC
This bit of code

        if (index > ncomponents
            || (index < 0 && index != -1)
            || comp instanceof Window
            || (comp instanceof Container
                && ((Container) comp).isAncestorOf(this)))
          throw new IllegalArgumentException();

throws the exception.
Comment 2 Andrew John Hughes 2007-11-12 21:51:18 UTC
The error is due to a -1 index it seems:

addImpl(javax.swing.JPanel[null.glassPane,0,0,0x0,invalid,invisible,translucent,doublebuffered,parent=null,layout=java.awt.FlowLayout,alignmentX=0.5,alignmentY=0.5,border=,maximumSize=java.awt.Dimension[width=32767,height=32767],minimumSize=java.awt.Dimension[width=10,height=10],preferredSize=java.awt.Dimension[width=10,height=10]],null,0)
addImpl(javax.swing.JLayeredPane[0,0,0x0,invalid,translucent,doublebuffered,parent=null,alignmentX=0.5,alignmentY=0.5,border=,maximumSize=java.awt.Dimension[width=32767,height=32767],minimumSize=java.awt.Dimension[width=0,height=0],preferredSize=java.awt.Dimension[width=0,height=0]],null,-1)
addImpl(javax.swing.JPanel[null.contentPane,0,0,0x0,invalid,doublebuffered,parent=null,layout=java.awt.BorderLayout,alignmentX=0.5,alignmentY=0.5,border=,maximumSize=java.awt.Dimension[width=2147483647,height=2147483647],minimumSize=java.awt.Dimension[width=0,height=0],preferredSize=java.awt.Dimension[width=0,height=0]],-30000,0)
addImpl(javax.swing.JRootPane[0,0,0x0,invalid,doublebuffered,parent=null,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,maximumSize=java.awt.Dimension[width=0,height=0],minimumSize=java.awt.Dimension[width=0,height=0],preferredSize=java.awt.Dimension[width=0,height=0]],Center,-1)
addImpl(javax.swing.JPanel[null.glassPane,0,0,0x0,invalid,invisible,translucent,doublebuffered,parent=null,layout=java.awt.FlowLayout,alignmentX=0.5,alignmentY=0.5,border=,maximumSize=java.awt.Dimension[width=32767,height=32767],minimumSize=java.awt.Dimension[width=10,height=10],preferredSize=java.awt.Dimension[width=10,height=10]],null,0)
addImpl(javax.swing.JLayeredPane[0,0,0x0,invalid,translucent,doublebuffered,parent=null,alignmentX=0.5,alignmentY=0.5,border=,maximumSize=java.awt.Dimension[width=32767,height=32767],minimumSize=java.awt.Dimension[width=0,height=0],preferredSize=java.awt.Dimension[width=0,height=0]],null,-1)
addImpl(javax.swing.JPanel[null.contentPane,0,0,0x0,invalid,doublebuffered,parent=null,layout=java.awt.BorderLayout,alignmentX=0.5,alignmentY=0.5,border=,maximumSize=java.awt.Dimension[width=2147483647,height=2147483647],minimumSize=java.awt.Dimension[width=0,height=0],preferredSize=java.awt.Dimension[width=0,height=0]],-30000,0)
addImpl(sun.tools.jconsole.JConsole$FixedJRootPane[0,0,0x0,invalid,doublebuffered,parent=null,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,maximumSize=java.awt.Dimension[width=0,height=0],minimumSize=java.awt.Dimension[width=0,height=0],preferredSize=java.awt.Dimension[width=0,height=0]],Center,-1)
Comment 3 Andrew John Hughes 2007-12-23 17:45:19 UTC
I've tracked down the bug.  It's nothing to do with the index.  Classpath claims that a container is an ancestor of itself, while Sun's implementation (IcedTea) doesn't.

i.e. 

Container c = new Container();
System.out.println(c.isAncestorOf(c));

returns true on Classpath but false on Sun.
Comment 4 Andrew John Hughes 2007-12-24 21:32:17 UTC
I've created dependent bugs to track the various problems with running JConsole.
Comment 5 Andrew John Hughes 2007-12-25 01:37:30 UTC
Current issue:

java -jar ~/build/fake_jdk.icedtea/lib/jconsole.jar
Exception during event dispatch:
java.lang.IllegalAccessException: method is not accessible
   at sun.tools.jconsole.AboutDialog.isBrowseSupported(AboutDialog.java:162)
   at sun.tools.jconsole.JConsole.<init>(JConsole.java:163)
   at sun.tools.jconsole.JConsole$6.run(JConsole.java:788)
   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:200)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:615)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:88)

Comment 6 Andrew John Hughes 2007-12-25 04:14:22 UTC
Now runs but still has issues.
Comment 7 Andrew John Hughes 2007-12-31 04:24:27 UTC
With PR34582 fixed, the JConsole run finally shows evidence of the missing JMX remote support (PR34278):

Exception in thread "JConsole.addHost" java.lang.InternalError: javax/management/remote/rmi/RMIServerImpl_Stub
   at sun.tools.jconsole.ProxyClient.<clinit>(ProxyClient.java:212)
   at sun.tools.jconsole.JConsole$3.run(JConsole.java:528)
Caused by: java.lang.ClassNotFoundException: javax/management/remote/rmi/RMIServerImpl_Stub
   at java.lang.VMClass.forName(Native Method)
   at java.lang.Class.forName(Class.java:187)
   at sun.tools.jconsole.ProxyClient.<clinit>(ProxyClient.java:209)
   ...1 more