java - JSF index out of bounds exception when submiting a form -
when click submit button in jsf form following exception occurs. says indexout of bounds exception, did not use arraylist associated code. bug? should rid of error..
mojarra: 2.0.2 fcs primefaces 2.2
jsf: 2.0
netbeans ide 6.8
glassfish domain v3
form code:
<p:panel id="jobres" style="min-width: 200px" header="reservation" widgetvar="jres" closable="true" toggleable="true" > <h:form id="arj" prependid="false" style="width:550px;max-height:400px;overflow:auto;"> <p:tooltip global="true"/> <h:panelgrid columns="2" > <p:panel style="min-width: 220px"> <h:outputlabel value="1.job type:"/> </p:panel> <h:panelgroup> <h:messages id="aerr"/> <h:selectonemenu title="choose jobtype" value="#{arjob.jobtype}"> <f:selectitem itemlabel="sequential" itemvalue="sequential"/> <f:selectitem itemlabel="parallel" itemvalue="parallel"/> </h:selectonemenu> </h:panelgroup> <p:panel> <h:outputlabel value="2.executable: *"/> </p:panel> <h:panelgroup> <p:fileupload id="aexeupload" fileuploadlistener="#{arjob.chooselistener}" auto="true" update="adlist :erdialog" description="resource files"> </p:fileupload> <br/> <h:panelgroup id="aexelistwrapper"> <p:datalist var="filelist" type="ordered" id="adlist" value="#{arjob.fexelist}"> <p:column> #{filelist} <p:commandlink ajax="true" update="aexelistwrapper" actionlistener="#{arjob.removeexe(filelist)}"> <p:graphicimage value="images/closebar.png"/> </p:commandlink> </p:column> </p:datalist> </h:panelgroup> </h:panelgroup> <p:panel> <h:outputlabel value="3.argument(s):"/> </p:panel> <h:panelgroup> <u style="color:orange"> <i> <p:inplace emptylabel="add arguments" oneditupdate="aarglist"> <h:inputtext title="enter arguments" id="aiparg" value="#{arjob.args}"> <f:ajax event="valuechange"/> </h:inputtext> <p:commandbutton update="aarglistwrapper erdialog" value="add" actionlistener="#{arjob.addarg}"/> </p:inplace> </i> </u> </h:panelgroup> <h:panelgroup> </h:panelgroup> <h:panelgroup> <h:panelgrid id="aarglistwrapper"> <p:datalist id="aarglist" type="ordered" var="args" value="#{arjob.arglist}"> <p:column id="col2"> #{args} <p:commandlink ajax="true" update="arj:arglistwrapper" actionlistener="#{arjob.removeargs(args)}"> <p:graphicimage title="remove" value="images/closebar.png"/> </p:commandlink> </p:column> </p:datalist> </h:panelgrid> </h:panelgroup> <p:panel> <h:outputlabel value="4.inputfile(s): *"/> </p:panel> <h:panelgroup> <p:fileupload id="ainpupload" fileuploadlistener="#{arjob.inputchooselistener}" auto="true" update="aipfilelistwrapper :erdialog" description="resource files"> </p:fileupload> <br/> <h:panelgroup id="aipfilelistwrapper"> <p:datalist var="ipfile" type="ordered" id="aipflist" value="#{arjob.finlist}"> <p:column> #{ipfile} <p:commandlink ajax="true" update="aipfilelistwrapper" actionlistener="#{arjob.removeinfile(ipfile)}"> <p:graphicimage value="images/closebar.png"/> </p:commandlink> </p:column> </p:datalist> </h:panelgroup> </h:panelgroup> <h:panelgroup> <p:panel > 5)output file(s): </p:panel> </h:panelgroup> <h:panelgroup> <u style="color:orange"> <i> <p:inplace emptylabel="add file name" id="aipexe"> <h:inputtext title="enter output filenames" id="aexe" value="#{arjob.ofilename}"> <f:ajax event="valuechange"/> </h:inputtext> <p:commandbutton update="adoutlist :erdialog" value="add" actionlistener="#{arjob.addoutfile}"/> </p:inplace> </i> </u> </h:panelgroup> <h:panelgroup> </h:panelgroup> <h:panelgroup> <h:panelgrid id="afilelistwrapper"> <p:datalist id="adoutlist" type="ordered" var="ofile" value="#{arjob.foutlist}"> <p:column id="acol"> #{ofile} <p:commandlink ajax="true" update="afilelistwrapper" actionlistener="#{arjob.removeoutfile(ofile)}"> <p:graphicimage value="images/closebar.png"/> </p:commandlink> </p:column> </p:datalist> </h:panelgrid> </h:panelgroup> <p:panel> <h:outputlabel value="6) operating system"/> </p:panel> <h:panelgroup> <h:selectonemenu title="select operatingsystem" value="#{arjob.os}"> <f:selectitem itemlabel="centos release 5.2" itemvalue="cent os 5.2"/> <f:selectitem itemlabel="rhel server release 5" itemvalue="rhel server 5"/> <f:selectitem itemlabel="rhel server release 5.2" itemvalue="rhel server 5.2"/> </h:selectonemenu> </h:panelgroup> <h:panelgroup> <p:panel> <h:outputlabel value="7) physical memory:"/> </p:panel> </h:panelgroup> <h:panelgroup> <p:spinner min="0" style="width: 100px" stepfactor="10" value="#{arjob.mem}"> </p:spinner>(mb) </h:panelgroup> <h:panelgroup> <p:panel> <h:outputlabel value="8) disk space:"/> </p:panel> </h:panelgroup> <h:panelgroup> <p:spinner min="0" style="width: 100px" stepfactor="10" value="#{arjob.diskspace}"> </p:spinner>(mb) </h:panelgroup> <h:panelgroup> <p:panel> <h:outputlabel value="9) cpu mhz:"/> </p:panel> </h:panelgroup> <h:panelgroup> <p:spinner min="0" style="width: 100px" stepfactor="10" value="#{arjob.cpumhz}"> </p:spinner>(mhz) </h:panelgroup> <p:panel> <h:outputlabel value="10) start time:"/> </p:panel> <h:panelgroup> <p:inputmask title="(yyyy-mm-dd hh:mm:ss)" mask="9999-99-99 99:99:99" value="#{arjob.startt}"> </p:inputmask> </h:panelgroup> <p:panel> <h:outputlabel value="11) end time:"/> </p:panel> <h:panelgroup> <p:inputmask title="(yyyy-mm-dd hh:mm:ss)" mask="9999-99-99 99:99:99" value="#{arjob.endt}"> <p:ajax event="valuechange"/> </p:inputmask> </h:panelgroup> <p:panel> <h:outputlabel value="12) lrms type"/> </p:panel> <h:panelgroup> <h:selectonemenu value="#{arjob.lrms}"> <f:selectitem itemlabel="pbs" itemvalue="pbs"/> <f:selectitem itemlabel="sge" itemvalue="sge"/> </h:selectonemenu> </h:panelgroup> <h:panelgroup> <p:panel> <h:outputlabel value="13)number of nodes: *"/> </p:panel> </h:panelgroup> <h:panelgroup> <h:panelgroup> <p:spinner style="width: 100px" min="1" max="100" value="#{arjob.numnodes}"> </p:spinner> </h:panelgroup> </h:panelgroup> <h:panelgroup> </h:panelgroup> <h:panelgroup> <p:commandbutton ajax="false" value="submit" action="#{arjob.jobsubmitaction}"/> </h:panelgroup> </h:panelgrid> </h:form> <p:draggable for="jobres" handle=".ui-panel-titlebar"/> </p:panel>
exception:
severe: javax.faces.facesexception: unexpected error restoring state component id j_idt7. cause: java.lang.indexoutofboundsexception: index: 0, size: 0. @ com.sun.faces.application.view.statemanagementstrategyimpl$2.visit(statemanagementstrategyimpl.java:239) @ com.sun.faces.component.visit.fullvisitcontext.invokevisitcallback(fullvisitcontext.java:147) @ javax.faces.component.uicomponent.visittree(uicomponent.java:1446) @ javax.faces.component.uicomponent.visittree(uicomponent.java:1457) @ javax.faces.component.uicomponent.visittree(uicomponent.java:1457) @ javax.faces.component.uicomponent.visittree(uicomponent.java:1457) @ com.sun.faces.application.view.statemanagementstrategyimpl.restoreview(statemanagementstrategyimpl.java:223) @ com.sun.faces.application.statemanagerimpl.restoreview(statemanagerimpl.java:177) @ com.sun.faces.application.view.viewhandlingstrategy.restoreview(viewhandlingstrategy.java:131) @ com.sun.faces.application.view.faceletviewhandlingstrategy.restoreview(faceletviewhandlingstrategy.java:430) @ com.sun.faces.application.view.multiviewhandler.restoreview(multiviewhandler.java:143) @ javax.faces.application.viewhandlerwrapper.restoreview(viewhandlerwrapper.java:288) @ com.sun.faces.lifecycle.restoreviewphase.execute(restoreviewphase.java:199) @ com.sun.faces.lifecycle.phase.dophase(phase.java:101) @ com.sun.faces.lifecycle.restoreviewphase.dophase(restoreviewphase.java:110) @ com.sun.faces.lifecycle.lifecycleimpl.execute(lifecycleimpl.java:118) @ javax.faces.webapp.facesservlet.service(facesservlet.java:312) @ org.apache.catalina.core.standardwrapper.service(standardwrapper.java:1523) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:343) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:215) @ org.primefaces.webapp.filter.fileuploadfilter.dofilter(fileuploadfilter.java:79) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:256) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:215) @ org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:277) @ org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:188) @ org.apache.catalina.core.standardpipeline.invoke(standardpipeline.java:641) @ com.sun.enterprise.web.webpipeline.invoke(webpipeline.java:97) @ com.sun.enterprise.web.pesessionlockingstandardpipeline.invoke(pesessionlockingstandardpipeline.java:85) @ org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:185) @ org.apache.catalina.connector.coyoteadapter.doservice(coyoteadapter.java:332) @ org.apache.catalina.connector.coyoteadapter.service(coyoteadapter.java:233) @ com.sun.enterprise.v3.services.impl.containermapper.service(containermapper.java:165) @ com.sun.grizzly.http.processortask.invokeadapter(processortask.java:791) @ com.sun.grizzly.http.processortask.doprocess(processortask.java:693) @ com.sun.grizzly.http.processortask.process(processortask.java:954) @ com.sun.grizzly.http.defaultprotocolfilter.execute(defaultprotocolfilter.java:170) @ com.sun.grizzly.defaultprotocolchain.executeprotocolfilter(defaultprotocolchain.java:135) @ com.sun.grizzly.defaultprotocolchain.execute(defaultprotocolchain.java:102) @ com.sun.grizzly.defaultprotocolchain.execute(defaultprotocolchain.java:88) @ com.sun.grizzly.http.httpprotocolchain.execute(httpprotocolchain.java:76) @ com.sun.grizzly.protocolchaincontexttask.docall(protocolchaincontexttask.java:53) @ com.sun.grizzly.selectionkeycontexttask.call(selectionkeycontexttask.java:57) @ com.sun.grizzly.contexttask.run(contexttask.java:69) @ com.sun.grizzly.util.abstractthreadpool$worker.dowork(abstractthreadpool.java:330) @ com.sun.grizzly.util.abstractthreadpool$worker.run(abstractthreadpool.java:309) @ java.lang.thread.run(thread.java:619) caused by: java.lang.indexoutofboundsexception: index: 0, size: 0 @ java.util.arraylist.rangecheck(arraylist.java:547) @ java.util.arraylist.get(arraylist.java:322) @ javax.faces.component.attachedobjectlistholder.restorestate(attachedobjectlistholder.java:161) @ javax.faces.component.uicomponentbase.restorestate(uicomponentbase.java:1427) @ com.sun.faces.application.view.statemanagementstrategyimpl$2.visit(statemanagementstrategyimpl.java:231) ... 45 more
i have found out bug in primefaces 2.2 final release, has been released recently.
i solved exception using previous version of primefaces (2.2 rc2)
Comments
Post a Comment