PDA

View Full Version : Random error on SourceSelectionChangedListener



Th0)M
18 May 2010, 6:51 AM
Hi,

I'm using GXT 2.1.1 and I periodically receive this error (maybe once a day) :



java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at com.extjs.gxt.ui.client.event.SourceSelectionChangedListener.selectionChanged(SourceSelectionChangedListener.java:29)
at com.extjs.gxt.ui.client.event.SelectionService.onSelectionChanged(SelectionService.java:112)
at com.extjs.gxt.ui.client.event.SelectionService$1.selectionChanged(SelectionService.java:39)
at com.extjs.gxt.ui.client.event.SelectionChangedListener.handleEvent(SelectionChangedListener.java:30)
at com.extjs.gxt.ui.client.event.SelectionChangedListener.handleEvent(SelectionChangedListener.java:1)
at com.extjs.gxt.ui.client.event.BaseObservable.callListener(BaseObservable.java:178)
at com.extjs.gxt.ui.client.event.BaseObservable.fireEvent(BaseObservable.java:86)
at com.extjs.gxt.ui.client.widget.selection.AbstractStoreSelectionModel.fireSelectionChange(AbstractStoreSelectionModel.java:379)
at com.extjs.gxt.ui.client.widget.selection.AbstractStoreSelectionModel.doMultiSelect(AbstractStoreSelectionModel.java:297)
at com.extjs.gxt.ui.client.widget.selection.AbstractStoreSelectionModel.doSelect(AbstractStoreSelectionModel.java:309)
at com.extjs.gxt.ui.client.widget.treepanel.TreePanelSelectionModel.onMouseDown(TreePanelSelectionModel.java:273)
at com.extjs.gxt.ui.client.widget.treepanel.TreePanelSelectionModel.handleEvent(TreePanelSelectionModel.java:120)
at com.extjs.gxt.ui.client.widget.treepanel.TreePanelSelectionModel.handleEvent(TreePanelSelectionModel.java:1)
at com.extjs.gxt.ui.client.event.BaseObservable.callListener(BaseObservable.java:178)
at com.extjs.gxt.ui.client.event.BaseObservable.fireEvent(BaseObservable.java:86)
at com.extjs.gxt.ui.client.widget.Component.fireEvent(Component.java:462)
at com.extjs.gxt.ui.client.widget.Component.onBrowserEvent(Component.java:878)
at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1307)
at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1263)
at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
at com.google.gwt.dev.shell.BrowserChannel.reactToMessagesWhileWaitingForReturn(BrowserChannel.java:1713)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:165)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:120)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:507)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:264)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:188)
at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157)
at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1668)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:401)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:222)
at java.lang.Thread.run(Thread.java:619)
This bug occurs when selecting an item on a treepanel :


SelectionService.get().addListener(new SourceSelectionChangedListener((SelectionProvider)tree.getSelectionModel()));
SelectionService.get().register((SelectionProvider)tree.getSelectionModel());The event triggers the loading of a grid :


SelectionService.get().addListener(new SelectionChangedListener<BeanModel>() {
public void selectionChanged(final SelectionChangedEvent<BeanModel> ev) {
loader.load();
}
});

When having this error the grid does not load and I have to reload the application (refresh the page) to make it work.

I use IE7 on Win XP.

Do you have an idea ?

Thank you,

Thomas

sven
18 May 2010, 6:59 AM
Can you please post a sampleapp that implements EntryPoint and shows your problem?

Th0)M
18 May 2010, 7:06 AM
I'll try but it won't be easy because the error does not happen very often as I said :(

sven
18 May 2010, 7:14 AM
Ok, i probably found the problem. I will chang the code for GXT 2.2