• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

java.lang.ArrayIndexOutOfBoundsException: 1 >= 0  RSS feed

 
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)
 
Marshal
Posts: 67164
169
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.
 
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.lang.ArrayIndexOutOfBoundsException
 
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

 
Sheriff
Posts: 21466
97
Chrome Eclipse IDE Java Spring Ubuntu VI Editor 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.
 
Author
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.
 
Marshal
Posts: 61774
193
  • 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
Marshal
Posts: 61774
193
  • 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
Boost this thread!