• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.lang.IndexOutOfBoundsException on one of our two presentation servers after getColumnClass()

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am a little perplexed with this one. We are running weblogic as our app servers in an admin with two managed servers clustered environment and two citrix presentation servers.

When we launch our application and open a certain project, one of our presentation servers works fine, the other crashes and generates the standard-out-output below, however no log files are ever written. To close the application i have to go through the task manager and select "End Task" button. I have verified that our execution paths are exactly the same on each presentation server. I assume that one of our servers does not like some data that is put into a certain column in our jtable but how come it works on the other server with the same path?? Any ideas? We execute with java 1.6 but the presentation servers default java paths are both 1.5.


java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at com.ams.enboss.common.ui.swing.tablemodel.TableModelEnbossBasic.getValueAt(TableModelEnbossBasic.java:31)
at com.ams.enboss.common.ui.swing.tablemodel.TableModelEnbossCommon.getColumnClass(TableModelEnbossCommon.java:95)
at javax.swing.JTable.getColumnClass(Unknown Source)
at com.mercury.ftjadin.support.jfc11.cs.JTableCS$CellEditorListenerRegistrar.addListener(JTableCS.java:139)
at com.mercury.ftjadin.infra.abstr.ObjectCS.registerListeners(ObjectCS.java:2607)
at com.mercury.ftjadin.infra.DefaultCustomClassManager.onCreate(DefaultCustomClassManager.java:555)
at com.mercury.ftjadin.hooks.WToolkitHook.onCreate(WToolkitHook.java:23)
at java.awt.Toolkit.createComponent(Unknown Source)
at java.awt.Component.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at javax.swing.JTable.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at javax.swing.JRootPane.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addImpl(Unknown Source)
at javax.swing.JLayeredPane.addImpl(Unknown Source)
at javax.swing.JDesktopPane.addImpl(Unknown Source)
at java.awt.Container.add(Unknown Source)
at com.ams.enboss.common.ui.swing.util.ChildWindowManagerEnboss.addFrame(ChildWindowManagerEnboss.java:96)
at com.ams.enboss.projdoc.client.ProjDoc$3.construct(ProjDoc.java:1045)
at com.ams.enboss.common.ui.swing.util.SwingWorkerEnboss$2.run(SwingWorkerEnboss.java:138)
at java.lang.Thread.run(Unknown Source)
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have a custom table model for the table? Does it use a list to store the data? Does your model override the getColumnClass, perhaps because of some custom renderers?
If all the answers to the above are yes, your getColumnClass lacks a null check. Remember the data list might not be null, but it can be empty!
 
Jared Sheehan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That still doesnt explain why it happens on one of our servers and not the other.

It looks like this is where the problem starts:

------------------------------------------
public Object getValueAt(int row, int col)
{
try
{
return ((List) data.get(row)).get(col);
}
catch (Exception e)
{
UIMessageManager.getInstance( Application.NAVIGATOR ).displayMessage( e );
}

return null;
}

------------------------------------------

In the catch statement should I throw a new exception and have a another class above it handle that exception?

This is where the exception actually occurs, looks like there is no try\catch null\IndexOutOfBoundsException check and it returns an Object.class if the value is null. I can update that but the question is still the same, why is this working on one server and not the other?

------------------------------------------
/**
* Returns the class of a given column in the table model
*
* @param col a column index
* @return the class of the given column
*/
public Class getColumnClass(int col)
{
if (getValueAt(0, col) != null)
{
return getValueAt(0, col).getClass();
}

return Object.class;
}
------------------------------------------
 
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

why is this working on one server and not the other?



There is no way we can answer that question. The code and or data is different.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Replying to an old issue but might be helpful to somebody. I came across similiar issues when using QTP. Try clearing the environment variable JAVA_TOOL_OPTIONS if it is set and see if this fixes the problem. Note that you will need to set it back to the old value when testing with QTP.

This would also explain why the problem occurs on one server and not the other. One might be used for QTP regression testing.

The com.mercury.ftjadin in the stacktrace is a hint as to the cause.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic