aspose file tools*
The moose likes JSF and the fly likes ArrayIndexOutOfBoundsException on h:inputText validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "ArrayIndexOutOfBoundsException on h:inputText validation" Watch "ArrayIndexOutOfBoundsException on h:inputText validation" New topic
Author

ArrayIndexOutOfBoundsException on h:inputText validation

Adam Greenberg
Greenhorn

Joined: Aug 16, 2010
Posts: 4
Thanks for taking the time to look over my issue. With the a few input fields I need to fire of a Boolean switch on the backing bean for an onchange action. This is so that when the user on the page is entering information and clicks a cancel button I can fire up a pop-up notifying him/her that if the want to leave they will lose all their info (and canceling the navigation if they don't wish to lose the info).

This all works fine and according to plan until I begin to test. I get this error when a user changes the value of one field, then another, and then changes the value of a filed he previously filled. I think it has something to do with the fact there is an onblur validation for the element as well as a4j:support checking for the onchange. It could also have something to do with the attribute being enclosed in a a4j:region, however, when I don't use the a4j:region for some reason the a4j:support is not fired off. I have also used ajaxSingle="true" as an attribute for the a4j:support on the inputText and get the same results (without it the a4j:support isn't fired off, with it I get the error). I can't find information on either elsewhere.

Below is the code. There are numerous fields on the form and in testing these first four I am always able to recreate the error so I figure adding all the fields would just be redundant. Also, at the bottom everything gets their appropriate closing tags:



Also, below is the stack trace for the error (sometimes it reads ArrayIndexOutOfBoundsException: -1 or ArrayIndexOutOfBoundsException: 6):
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at java.util.ArrayList.fastRemove(Unknown Source)
at java.util.ArrayList.remove(Unknown Source)
at javax.faces.component.UIComponentBase$AttributesMap.remove(UIComponentBase.java:1695)
at com.sun.facelets.tag.jsf.ComponentSupport.finalizeForDeletion(ComponentSupport.java:54)
at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:173)
at com.sun.facelets.tag.jsf.core.ViewHandler.apply(ViewHandler.java:109)
at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:524)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)
at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Unknown Source)

Thanks again for taking a look as well as in advance for providing any help.

Cheers.
Thomas Rochon
Ranch Hand

Joined: Jul 11, 2002
Posts: 72
Hi Adam,

have you found a solution for your problem? In my case it doesn't seem to be the h:inputText validation, but my stack trace looks exactly the same.
I already searched the forums and Google for an answer, but without success. I'm desperately searching for a solution.

Thanks and cheers!
Thomas
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ArrayIndexOutOfBoundsException on h:inputText validation
 
Similar Threads
javax.el.PropertyNotFoundException
Error while giving action Handler in JSF
I need help with ajaxSingle, reRender and immediate.
rich:comboBox fails to reRender due to rich:ajaxValidator
myfaces datatable