<Swing Dev> jconsole exceptions

dmitry markov dmitry.markov at oracle.com
Mon Jun 10 09:58:32 UTC 2013


Hi Andreas,

I built JDK 8 with the fix made under 8015853 and ran jconsole as you 
described below (connect to the process, etc.). I did not observe any 
ArrayIndexOutOfBoundsException.

It seems to me, you have to replace the following line:
     index1 = getViewIndex(elem.getDocument().getLength(), 
Position.Bias.Forward);
by this one
     index1 = Math.max((getViewCount() - 1), 0);
and then re-build the JDK 8. This should fix the problem with 
ArrayIndexOutOfBoundsException.

Thanks,
Dmitry

On 07/06/2013 19:42, Andreas Rieber wrote:
> Hi Alexander,
>
> you need to connect to a process. I used a tomcat but any other has 
> same problem. The exception details are below in the followups.
>
> Andreas
>
> On 07.06.13 16:29, Alexander Scherbatiy wrote:
>> On 6/7/2013 6:04 PM, Andreas Rieber wrote:
>>> Hi Alexander,
>>>
>>> i know that this fix is in, but it causes now the mentioned 
>>> exceptions. In case of jconsole it pops up the error window with the 
>>> exception all the time.
>>> So i commented that fix out and the exceptions stop, meaning the fix 
>>> causes just other problems (also JDK-8015853).
>>
>>    It is strange. I just rebuild the JDK 8 with the index1 that is 
>> calculated as
>>        index1 = Math.max((getViewCount() - 1), 0);
>>    and run jconsole on Ubuntu.  I do not see the 
>> ArrayIndexOutOfBoundsException.
>>
>>   Could you give more details bout the jconsole exception. Is it 
>> thrown just after the jconsole starting or do I need to connect to a 
>> process and select a tab?
>>
>>   Thanks,
>>   Alexandr.
>>
>>>
>>> Andreas
>>>
>>>
>>> On 07.06.13 15:57, Alexander Scherbatiy wrote:
>>>> On 6/7/2013 2:58 PM, Andreas Rieber wrote:
>>>>> Hi Sergey,
>>>>>
>>>>> it is actually the change from JDK-8014863 causing the new 
>>>>> exceptions. When i comment that line out the exceptions are gone.
>>>>>
>>>>
>>>>     The issue 8014863 should be already fixed in JDK 8: 
>>>> hg.openjdk.java.net/jdk8/awt/jdk/rev/cb7f711e1752
>>>>
>>>>     Could you update the sources and rebuilt it.
>>>>
>>>>    Thanks,
>>>>    Alexandr.
>>>>
>>>>> Andreas
>>>>>
>>>>> changeset:   7194:c8a0abc1fd2d
>>>>> user:        mcherkas
>>>>> date:        Wed May 29 18:40:02 2013 +0400
>>>>> summary:     8014863: Line break calculations in Java 7 are 
>>>>> incorrect.
>>>>>
>>>>> diff -r 1f0628078531 -r c8a0abc1fd2d 
>>>>> src/share/classes/javax/swing/text/View.java
>>>>> --- a/src/share/classes/javax/swing/text/View.java    Wed May 29 
>>>>> 12:10:49 2013 +0400
>>>>> +++ b/src/share/classes/javax/swing/text/View.java    Wed May 29 
>>>>> 18:40:02 2013 +0400
>>>>> @@ -1,5 +1,5 @@
>>>>>  /*
>>>>> - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All 
>>>>> rights reserved.
>>>>> + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All 
>>>>> rights reserved.
>>>>>   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
>>>>>   *
>>>>>   * This code is free software; you can redistribute it and/or 
>>>>> modify it
>>>>> @@ -1174,6 +1174,7 @@
>>>>>          // formed by added elements (i.e. they will be updated
>>>>>          // by initialization.
>>>>>          index0 = Math.max(index0, 0);
>>>>> +        index1 = getViewIndex(elem.getDocument().getLength(), 
>>>>> Position.Bias.Forward);
>>>>>          for (int i = index0; i <= index1; i++) {
>>>>>              if (! ((i >= hole0) && (i <= hole1))) {
>>>>>                  v = getView(i);
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On 06.06.13 12:13, Andreas Rieber wrote:
>>>>>> OK, thanks. i didn't find that issue.
>>>>>>
>>>>>> On 06.06.13 12:07, Sergey Bylokhov wrote:
>>>>>>> Hi, Andreas.
>>>>>>> This is a known issue in the latest jdk8 build.
>>>>>>> JDK-8015853
>>>>>>>
>>>>>>> On 06.06.2013 13:30, Andreas Rieber wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> i did a new build 1 hour ago of latest jdk8 and jdk8-tl, in 
>>>>>>>> both the jconsole throws now exceptions. It did work the day 
>>>>>>>> before. OS ubuntu 12.04.
>>>>>>>>
>>>>>>>> Andreas
>>>>>>>>
>>>>>>>> Exception in thread "AWT-EventQueue-0" 
>>>>>>>> java.lang.ArrayIndexOutOfBoundsException: 11
>>>>>>>>     at 
>>>>>>>> javax.swing.text.CompositeView.getView(CompositeView.java:160)
>>>>>>>>     at javax.swing.text.View.forwardUpdate(View.java:1151)
>>>>>>>>     at javax.swing.text.BoxView.forwardUpdate(BoxView.java:240)
>>>>>>>>     at 
>>>>>>>> javax.swing.text.html.TableView.forwardUpdate(TableView.java:894)
>>>>>>>>     at javax.swing.text.View.changedUpdate(View.java:788)
>>>>>>>>     at 
>>>>>>>> javax.swing.text.html.TableView.changedUpdate(TableView.java:889)
>>>>>>>>     at javax.swing.text.View.forwardUpdateToView(View.java:1212)
>>>>>>>>     at javax.swing.text.View.forwardUpdate(View.java:1183)
>>>>>>>>     at javax.swing.text.BoxView.forwardUpdate(BoxView.java:240)
>>>>>>>>     at javax.swing.text.View.changedUpdate(View.java:788)
>>>>>>>>     at 
>>>>>>>> javax.swing.text.html.BlockView.changedUpdate(BlockView.java:341)
>>>>>>>>     at javax.swing.text.View.forwardUpdateToView(View.java:1212)
>>>>>>>>     at javax.swing.text.View.forwardUpdate(View.java:1183)
>>>>>>>>     at javax.swing.text.BoxView.forwardUpdate(BoxView.java:240)
>>>>>>>>     at javax.swing.text.View.changedUpdate(View.java:788)
>>>>>>>>     at 
>>>>>>>> javax.swing.text.html.BlockView.changedUpdate(BlockView.java:341)
>>>>>>>>     at 
>>>>>>>> javax.swing.plaf.basic.BasicTextUI$RootView.changedUpdate(BasicTextUI.java:1630)
>>>>>>>>     at 
>>>>>>>> javax.swing.plaf.basic.BasicTextUI$UpdateHandler.changedUpdate(BasicTextUI.java:1891)
>>>>>>>>     at 
>>>>>>>> javax.swing.text.AbstractDocument.fireChangedUpdate(AbstractDocument.java:230)
>>>>>>>>     at 
>>>>>>>> javax.swing.text.html.HTMLDocument.fireChangedUpdate(HTMLDocument.java:1729)
>>>>>>>>     at 
>>>>>>>> javax.swing.text.html.HTMLDocument$HTMLReader.adjustEndElement(HTMLDocument.java:2470)
>>>>>>>>     at 
>>>>>>>> javax.swing.text.html.HTMLDocument$HTMLReader.flush(HTMLDocument.java:2525)
>>>>>>>>     at 
>>>>>>>> javax.swing.text.html.HTMLEditorKit.read(HTMLEditorKit.java:263)
>>>>>>>>     at javax.swing.JEditorPane.setText(JEditorPane.java:1415)
>>>>>>>>     at sun.tools.jconsole.HTMLPane.setText(HTMLPane.java:62)
>>>>>>>>     at sun.tools.jconsole.SummaryTab$1.done(SummaryTab.java:95)
>>>>>>>>     at javax.swing.SwingWorker$5.run(SwingWorker.java:737)
>>>>>>>>     at 
>>>>>>>> javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(SwingWorker.java:832)
>>>>>>>>     at 
>>>>>>>> sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:112)
>>>>>>>>     at 
>>>>>>>> javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(SwingWorker.java:842)
>>>>>>>>     at javax.swing.Timer.fireActionPerformed(Timer.java:313)
>>>>>>>>     at javax.swing.Timer$DoPostEvent.run(Timer.java:245)
>>>>>>>>     at 
>>>>>>>> java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
>>>>>>>>     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:726)
>>>>>>>>     at java.awt.EventQueue.access$200(EventQueue.java:103)
>>>>>>>>     at java.awt.EventQueue$3.run(EventQueue.java:687)
>>>>>>>>     at java.awt.EventQueue$3.run(EventQueue.java:685)
>>>>>>>>     at java.security.AccessController.doPrivileged(Native Method)
>>>>>>>>     at 
>>>>>>>> java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
>>>>>>>>     at java.awt.EventQueue.dispatchEvent(EventQueue.java:696)
>>>>>>>>     at 
>>>>>>>> java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:220)
>>>>>>>> ...
>>>>>>>>
>>>>
>>>
>>
>




More information about the swing-dev mailing list