Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.ArrayIndexOutOfBoundsException: 1 >= 0

 
John Teh
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When Java console displays the following message, what does it mean ?

java.lang.ArrayIndexOutOfBoundsException: 1 >= 0

at java.util.Vector.elementAt(Unknown Source)
at cu.a(Unknown Source)
at cu.a(Unknown Source)
at eE.a(Unknown Source)
at cU.b(Unknown Source)
at bP.paint(Unknown Source)
at javax.swing.JComponent.paintToOffscreen(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)
at javax.swing.RepaintManager.paint(Unknown Source)
at javax.swing.JComponent._paintImmediately(Unknown Source)
at javax.swing.JComponent.paintImmediately(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(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)
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please check your private messages for an important administrative matter.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
 
Suhas Bilaye
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Teh Sy,

The exception ArrayIndexOutOfBounds appears when you try to access any element from the list or array or collection which is greater than or equal to the current size(since the index starts from 0 and not from 1).

For example:

In your case too, you are accessing element no 1 out of the array/list/any other collection which does not contain any elements i.e. the size is of collection is 0

Regards,
Suhas

 
Rob Spoor
Sheriff
Pie
Posts: 20667
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show us the code for class "cu", method "a"? Because that's where the exception is coming from. It passes an invalid index to a vector's elementAt method.
 
John Teh
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to JAVA, so I don't know what {code for class "cu", method "a" } is.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your stack trace includes the following:So there are classes and methods being called for which we have no information. Given the names, I'd guess they're being generated. The bottom line is that somewhere there's an array that the above code is expecting to have values, and there are none.
 
Campbell Ritchie
Sheriff
Pie
Posts: 50225
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John Teh wrote:I am new to JAVA, so I don't know what {code for class "cu", method "a" } is.
Why is somebody giving you code you don't know about, then?
 
John Teh
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You see I am using an online software and run into problem and I look into the Java console and found these message. Thought I am new to Java, I have some background on programming in BASIC. I suspect there are some bugs in the program or some problem with the server. When I bring the matter to the vendor, there is no solution so far (already months, they still don't know what is the problem). So I am just want to learn some knowledge about Java. So far, I am satisfied with the answer provide by Suhas Bilaye and I have requested topic as resoved. Thank you for that.
 
Campbell Ritchie
Sheriff
Pie
Posts: 50225
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What a job you have got!
You're welcome, and as you say, Suhas Bilaye gave you a correct answer. I'll click the "resolved" button.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic