Win a copy of The Career Toolkit this week in the Jobs Discussion forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

java.lang.IndexOutOfBoundsException

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I get the below exception at times when i click on the submint button. The Jsp displays HTTP 500 error with the below exception trace in the log. Could any one let me know how to overcome this?

[7/16/12 15:48:22:485 GMT] 0000002f jsf E com.sun.faces.lifecycle.InvokeApplicationPhase execute Index: 0, Size: 0

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

at java.util.ArrayList.RangeCheck(ArrayList.java:572)

at java.util.ArrayList.remove(ArrayList.java:415)

at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:302)

at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:412)

at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:77)

at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:220)

at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91)

at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)

at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)

at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)

at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)

at com.metlife.calcs.action.GIDVFilterImpl.doFilter(GIDVFilterImpl.java:159)

at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)

at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)

at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)

at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)

at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)

at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)

at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)

at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:92)

at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)

at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)

at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)

at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)

at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)

at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:274)

at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)

at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)

at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)

at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)

at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)

at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)

at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)

at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)

at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)

at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)



[7/16/12 15:48:22:491 GMT] 0000002f ServletWrappe E SRVE0068E: Uncaught exception thrown in one of the service methods of the servlet: Faces Servlet. Exception thrown : javax.servlet.ServletException: Index: 0, Size: 0

at javax.faces.webapp.FacesServlet.service(FacesServlet.java:209)

at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)

at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)

at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)

at com.metlife.calcs.action.GIDVFilterImpl.doFilter(GIDVFilterImpl.java:159)

at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)

at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)

at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)

at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)

at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)

at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)

at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)

at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:92)

at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)

at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)

at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)

at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)

at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)

at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:274)

at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)

at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)

at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)

at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)

at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)

at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)

at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)

at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)

at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)

at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)

---- Begin backtrace for Nested Throwables

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

at java.util.ArrayList.RangeCheck(ArrayList.java:572)

at java.util.ArrayList.remove(ArrayList.java:415)

at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:302)

at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:412)

at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:77)

at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:220)

at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91)

at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)

at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)

at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)

at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)

at com.metlife.calcs.action.GIDVFilterImpl.doFilter(GIDVFilterImpl.java:159)

at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)

at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)

at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)

at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)

at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)

at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)

at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)

at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:92)

at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)

at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)

at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)

at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)

at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)

at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:274)

at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)

at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)

at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)

at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)

at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)

at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)

at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)

at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)

at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)

at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)



[7/16/12 15:48:22:509 GMT] 0000002f WebApp E [Servlet Error]-[Faces Servlet]: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

at java.util.ArrayList.RangeCheck(ArrayList.java:572)

at java.util.ArrayList.remove(ArrayList.java:415)

at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:302)

at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:412)

at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:77)

at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:220)

at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91)

at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)

at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)

at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)

at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)

at com.metlife.calcs.action.GIDVFilterImpl.doFilter(GIDVFilterImpl.java:159)

at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)

at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)

at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)

at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)

at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)

at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)

at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)

at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:92)

at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)

at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)

at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)

at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)

at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)

at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:274)

at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)

at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)

at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)

at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)

at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)

at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)

at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)

at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)

at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)

at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)



 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would you post a code snippet? That would help...
Scott Nameth
 
Ram Prakash Jayapalan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Scott,

This happens when multiple requests are handled. Say if the user clicks the submit button twice. But from my end i do not wish to disable the button after single click. Instead i wanted the response of the first request alone to be displayed in the jsp. Any idea how to implement this?

Thanks,
Ram
 
Saloon Keeper
Posts: 22986
156
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When someone double-clicks a submit button or link, two separate HTTP requests are made. In most web clients (browsers), what will also happen is that the reply port on the client side attached to the first request will be closed and that will cause server responses for the first request to fail to transmit fully. However, the server doesn't know about that yet, so both requests will go through the request processor.

Which means that it's far more important to restrict what gets updated than what gets displayed. For one thing, if the updates are done right, it won't matter that the second request display is what the client will actually receive back.

Disabling the submit button can help, but for best results, the webapp should detect and discard redundant updates.

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic