0

I'm getting this stack trace:

Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 3 at test$2$1.actionPerformed(test.java:230) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(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.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$500(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(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 

from this code:

Registry r = LocateRegistry.createRegistry(Integer.parseInt(tb_port[i].getText())); 
3
  • That's a lot of code. Which is line 230? Commented Mar 21, 2015 at 20:40
  • @MadProgrammer yeah infortunitelly, it's the one before the word 'next' Commented Mar 21, 2015 at 20:47
  • 2
    ArrayIndexOutOfBoundsException has nothing to do with RMI. Neither does 880 yards of Swing code. You really need to learn to read a stack trace, and how to distinguish relevance from irrelevance Commented Mar 21, 2015 at 23:00

1 Answer 1

1
ArrayIndexOutOfBoundsException: 3 

and

tp_port[i] 

i is 3, and tp_port[] only has 3 or fewer elements.

Sign up to request clarification or add additional context in comments.

2 Comments

@shinjw Lest the OP and future readers be confused, there is no guessing here whatsoever. It follows directly from the exception. If the OP hadn't posted half a mile of 99% irrelevant code I might have delved further into the underlying cause.
Totally misphrased that. Did not mean to use the word guess. OP made an insightful question. And you provided clear and concise answer.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.