From: Knute Johnson on
I've got some production code and at one site I keep getting an
ArrayIndexOutOfBoundsException. The problem is that there is no line
number in the stack trace so I don't know where this is happening. The
error is posted below. This one user must be doing something different
than the other two but I can't get them to give me any details (which is
very typical). I can give them modified code easily so any ideas on how
to track this?

Thanks,

C:\terminal>java
-Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAnd
Feel -Xms200m -Xmx240m -jar Terminal.jar
Terminal - Version: 04.11 - 08 Oct 09

Exception in thread "AWT-EventQueue-0"
java.lang.ArrayIndexOutOfBoundsException:
4
at sun.font.FontDesignMetrics.charsWidth(Unknown Source)
at javax.swing.text.Utilities.getTabbedTextOffset(Unknown Source)
at javax.swing.text.Utilities.getTabbedTextOffset(Unknown Source)
at javax.swing.text.Utilities.getTabbedTextOffset(Unknown Source)
at javax.swing.text.PlainView.viewToModel(Unknown Source)
at javax.swing.text.FieldView.viewToModel(Unknown Source)
at
javax.swing.plaf.basic.BasicTextUI$RootView.viewToModel(Unknown Sourc
e)
at javax.swing.plaf.basic.BasicTextUI.viewToModel(Unknown Source)
at javax.swing.text.DefaultCaret.moveCaret(Unknown Source)
at javax.swing.text.DefaultCaret.mouseDragged(Unknown Source)
at java.awt.AWTEventMulticaster.mouseDragged(Unknown Source)
at java.awt.Component.processMouseMotionEvent(Unknown Source)
at javax.swing.JComponent.processMouseMotionEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown
Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0"
java.lang.ArrayIndexOutOfBoundsException:
38
at sun.font.FontDesignMetrics.charsWidth(Unknown Source)
at javax.swing.text.Utilities.getTabbedTextOffset(Unknown Source)
at javax.swing.text.Utilities.getTabbedTextOffset(Unknown Source)
at javax.swing.text.Utilities.getTabbedTextOffset(Unknown Source)
at javax.swing.text.PlainView.viewToModel(Unknown Source)
at javax.swing.text.FieldView.viewToModel(Unknown Source)
at
javax.swing.plaf.basic.BasicTextUI$RootView.viewToModel(Unknown Sourc
e)
at javax.swing.plaf.basic.BasicTextUI.viewToModel(Unknown Source)
at javax.swing.text.DefaultCaret.positionCaret(Unknown Source)
at javax.swing.text.DefaultCaret.adjustCaret(Unknown Source)
at javax.swing.text.DefaultCaret.adjustCaretAndFocus(Unknown
Source)
at javax.swing.text.DefaultCaret.mousePressed(Unknown Source)
at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown
Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
--

Knute Johnson
email s/nospam/knute2009/

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
From: John B. Matthews on
In article <4b16b477$0$26182$b9f67a60(a)news.newsdemon.com>,
Knute Johnson <nospam(a)rabbitbrush.frazmtn.com> wrote:

> I've got some production code and at one site I keep getting an
> ArrayIndexOutOfBoundsException. The problem is that there is no line
> number in the stack trace so I don't know where this is happening.
> The error is posted below. This one user must be doing something
> different than the other two but I can't get them to give me any
> details (which is very typical). I can give them modified code
> easily so any ideas on how to track this?
>
> Thanks,
>
> C:\terminal>java
> -Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAnd
> Feel -Xms200m -Xmx240m -jar Terminal.jar
> Terminal - Version: 04.11 - 08 Oct 09
>
> Exception in thread "AWT-EventQueue-0"
> java.lang.ArrayIndexOutOfBoundsException:
> 4
> at sun.font.FontDesignMetrics.charsWidth(Unknown Source)
> at javax.swing.text.Utilities.getTabbedTextOffset(Unknown Source)
> at javax.swing.text.Utilities.getTabbedTextOffset(Unknown Source)
> at javax.swing.text.Utilities.getTabbedTextOffset(Unknown Source)
> at javax.swing.text.PlainView.viewToModel(Unknown Source)
> at javax.swing.text.FieldView.viewToModel(Unknown Source)
....

I stumbled upon a similar stacktrace in this bug report and discussion:

<http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6857057>
<http://forums.sun.com/thread.jspa?threadID=5407111>

--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
From: Martin Gregorie on
On Wed, 02 Dec 2009 10:39:50 -0800, Knute Johnson wrote:

> I've got some production code and at one site I keep getting an
> ArrayIndexOutOfBoundsException. The problem is that there is no line
> number in the stack trace so I don't know where this is happening. The
> error is posted below. This one user must be doing something different
> than the other two but I can't get them to give me any details (which is
> very typical). I can give them modified code easily so any ideas on how
> to track this?
>
I don't have any directly relevant comments - sorry - and the following
is probably not directly relevant because retrofitting would be tedious,
but it may give you some ideas:

I have never got on with debuggers, so I tend to load up my programs with
trace statements that output to stderr. So far, so conventional, however
I also add command line options to control debugging detail by setting a
'debug' integer and always leave this stuff in production code because
the speed impact of testing integer values and skipping debug statements
is minimal and the diagnostic value of this trick during live running is
huge.

An even better trick I learned from an ancient OS (ICL George 3) is to
leave tracing permanently active but to send it to a circular buffer.
Dumping the buffer is triggered by fatal errors, so you get the error
plus the program actions leading to it. The overhead of this approach is
a bit higher, but again not really noticeable. The benefit is that you
are guaranteed to get a manageable amount of diagnostics from any crash.


Martin



--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
From: Arne Vajhøj on
Martin Gregorie wrote:
> I have never got on with debuggers, so I tend to load up my programs with
> trace statements that output to stderr. So far, so conventional, however
> I also add command line options to control debugging detail by setting a
> 'debug' integer and always leave this stuff in production code because
> the speed impact of testing integer values and skipping debug statements
> is minimal and the diagnostic value of this trick during live running is
> huge.

I completely agree that debuggers are great for debugging toy programs,
but log output is often much better for real world programs.

But I would use log4j instead of something home made.

Arne
From: Knute Johnson on
John B. Matthews wrote:
> In article <4b16b477$0$26182$b9f67a60(a)news.newsdemon.com>,
> Knute Johnson <nospam(a)rabbitbrush.frazmtn.com> wrote:
>
>> I've got some production code and at one site I keep getting an
>> ArrayIndexOutOfBoundsException. The problem is that there is no line
>> number in the stack trace so I don't know where this is happening.
>> The error is posted below. This one user must be doing something
>> different than the other two but I can't get them to give me any
>> details (which is very typical). I can give them modified code
>> easily so any ideas on how to track this?
>>
>> Thanks,
>>
>> C:\terminal>java
>> -Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAnd
>> Feel -Xms200m -Xmx240m -jar Terminal.jar
>> Terminal - Version: 04.11 - 08 Oct 09
>>
>> Exception in thread "AWT-EventQueue-0"
>> java.lang.ArrayIndexOutOfBoundsException:
>> 4
>> at sun.font.FontDesignMetrics.charsWidth(Unknown Source)
>> at javax.swing.text.Utilities.getTabbedTextOffset(Unknown Source)
>> at javax.swing.text.Utilities.getTabbedTextOffset(Unknown Source)
>> at javax.swing.text.Utilities.getTabbedTextOffset(Unknown Source)
>> at javax.swing.text.PlainView.viewToModel(Unknown Source)
>> at javax.swing.text.FieldView.viewToModel(Unknown Source)
> ...
>
> I stumbled upon a similar stacktrace in this bug report and discussion:
>
> <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6857057>
> <http://forums.sun.com/thread.jspa?threadID=5407111>
>

John:

That looks like the problem and it explains why the other sites don't
have it because they're older and don't have the latest JRE.

Thanks,

--

Knute Johnson
email s/nospam/knute2009/

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access