Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Array Out of Bounds Exception

4 views
Skip to first unread message

ramesh

unread,
Mar 18, 2004, 2:03:27 AM3/18/04
to
HI all,
Iam a newbie to java and debugging a program(s). Iam unable to
figure out the Array out of bounds exception iam facing with. The
exceptions iam getting is as below:
Can you plz. tell me where to start with. From the stack trace doesit
mean that the error has occured in JSDOGeometry.java's reOrientCurves
method? If so, even if I print some thing in this method ( even as the
first statement in the method),its not getting printed. please guide
me.
Thanks in advance,
ramesh

map:
[java] java.lang.ArrayIndexOutOfBoundsException
[java] at oracle.sdovis.JSDOGeometry.reOrientCurves(JSDOGeometry.java:1
223)
[java] at oracle.sdovis.JSDOGeometry.loadAndReorient(JSDOGeometry.java:
1019)
[java] at oracle.sdovis.JDBCDataSource4PT.loadFeaturesInWindow(JDBCData
Source4PT.java:195)
[java] at oracle.sdovis.JDBCDataSource4PT.prepareFeatures(JDBCDataSourc
e4PT.java:124)
[java] at oracle.sdovis.PredefinedTheme.prepareData(PredefinedTheme.jav
a:76)
[java] at oracle.sdovis.DBMapMaker.prepareThemes(DBMapMaker.java:679)
[java] at oracle.sdovis.DBMapMaker.renderEm(DBMapMaker.java:572)
[java] at oracle.sdovis.MapMaker.renderMap(MapMaker.java:1150)
[java] at oracle.spatial.mapserver.RealWorker.generateMapImage(RealWork
er.java:248)
[java] at oracle.spatial.mapserver.RealWorker.process(RealWorker.java:6
3)
[java] at oracle.spatial.mapserver.MapServerImpl.renderMap(MapServerImp
l.java:115)
[java] at truss.map.MapPanel.renderMap(MapPanel.java:299)
[java] at truss.map.MapPanel.panRight(MapPanel.java:501)
[java] at truss.map.MapControlPanel.btnPanRight_actionPerformed(MapCont
rolPanel.java:171)
[java] at truss.map.MapControlPanel$6.actionPerformed(MapControlPanel.j
ava:121)
[java] at javax.swing.AbstractButton.fireActionPerformed(AbstractButton
.java:1445)
[java] at javax.swing.AbstractButton$ForwardActionEvents.actionPerforme
d(AbstractButton.java:1499)
[java] at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultBut
tonModel.java:373)
[java] at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.
java:245)
[java] at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Basi
cButtonListener.java:211)
[java] at java.awt.Component.processMouseEvent(Component.java:3710)
[java] at java.awt.Component.processEvent(Component.java:3539)
[java] at java.awt.Container.processEvent(Container.java:1159)
[java] at java.awt.Component.dispatchEventImpl(Component.java:2588)
[java] at java.awt.Container.dispatchEventImpl(Container.java:1208)
[java] at java.awt.Component.dispatchEvent(Component.java:2492)
[java] at java.awt.LightweightDispatcher.retargetMouseEvent(Container.j
ava:2451)
[java] at java.awt.LightweightDispatcher.processMouseEvent(Container.ja
va:2216)
[java] at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2
125)
[java] at java.awt.Container.dispatchEventImpl(Container.java:1195)
[java] at java.awt.Window.dispatchEventImpl(Window.java:923)
[java] at java.awt.Component.dispatchEvent(Component.java:2492)
[java] at java.awt.EventQueue.dispatchEvent(EventQueue.java:334)
[java] at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDi
spatchThread.java:126)
[java] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDisp
atchThread.java:93)
[java] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.j
ava:88)
[java] at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)

Andrew Thompson

unread,
Mar 18, 2004, 2:51:18 AM3/18/04
to
On 17 Mar 2004 23:03:27 -0800, ramesh wrote:

> HI all,
> Iam a newbie to java and debugging a program(s).

Specifically what this group is not for, try..
<http://www.physci.org/codes/javafaq.jsp#cljh>

>..Iam unable to


> figure out the Array out of bounds exception iam facing with. The
> exceptions iam getting is as below:
> Can you plz. tell me where to start with. From the stack trace doesit
> mean that the error has occured in JSDOGeometry.java's reOrientCurves
> method?

Yes. You are apparently traversing
an array in it apparently.

>..If so, even if I print some thing in this method

What are you printing?

> map:
> [java] java.lang.ArrayIndexOutOfBoundsException
> [java] at oracle.sdovis.JSDOGeometry.reOrientCurves(JSDOGeometry.java:1
> 223)

You wrote this class, right?

The error is telling you to look at line 223
of the source. That is where the AIOOB exception
is occuring.

I cannot see line 223 of your code from here,
but from the sounds of the length of it..
No, do not post it to the group as is. ;-)

--
Andrew Thompson
* http://www.PhySci.org/ Open-source software suite
* http://www.PhySci.org/codes/ Web & IT Help
* http://www.1point1C.org/ Science & Technology

Kenneth Ahn Jensen

unread,
Mar 18, 2004, 6:35:54 AM3/18/04
to
Andrew Thompson wrote:

> On 17 Mar 2004 23:03:27 -0800, ramesh wrote:
>

>> [oracle.sdovis.JSDOGeometry.reOrientCurves(JSDOGeometry.java:1


>> 223)
>
> You wrote this class, right?
>
> The error is telling you to look at line 223

Even worse - it is at line 1223 (linebreak in the number). ;)

...

Hello Ramesh

ArrayIndexOutOfBoundsExceptions occur when you tell Java to access an
array-element at a place that is outside the actual array.
For instance if I do this:

int[] int_array = int[8];
for( int i = 0; i <= int_array.length; i++)
int_array[i] = i;

-then it will generate an ArrayIndex...Exception when i reaches 8, because
the array only has places 0,...,7 - equal to (int_array.length - 1).
So check that you are not using a loop-condition that looks like
i <= array.length
-anywhere near line 1223 in your code.

--
Mvh Kenneth

Fjern en mail fra min emailadresse.
Remove one mail from my email address.

Andrew Thompson

unread,
Mar 18, 2004, 6:46:23 AM3/18/04
to
On Thu, 18 Mar 2004 12:35:54 +0100, Kenneth Ahn Jensen wrote:
> Andrew Thompson wrote:
>> On 17 Mar 2004 23:03:27 -0800, ramesh wrote:
>>
>>> [oracle.sdovis.JSDOGeometry.reOrientCurves(JSDOGeometry.java:1
>>> 223)
..

>> The error is telling you to look at line 223
>
> Even worse - it is at line 1223 (linebreak in the number). ;)

Missed it by _that_ much. ;-)

0 new messages