2 Replies Latest reply on Mar 29, 2012 4:21 AM by nimo stephan

    java.lang.StringIndexOutOfBoundsException jsf renderkit

    nimo stephan Master

      Can someone tell me what this failure means:

       

      This is the full stacktrace after submiting a form via

      <f:ajax execute="@form" render="@form" />

       

      You see, there is no bean of my applicationlogic within the stacktrace, so it seems that this failure lies within jsf 2 or rf? I dont know.

       

       

      14:10:56,395 Information [javax.enterprise.resource.webcontainer.jsf.context] (http-localhost-127.0.0.1-8080-1) java.lang.StringIndexOutOfBoundsException: String index out of range: -1: java.lang.StringIndexOutOfBoundsException: String index out of range: -1

          at java.lang.String.substring(String.java:1958) [rt.jar:1.7.0_01]

          at com.sun.faces.renderkit.html_basic.SelectManyCheckboxListRenderer.isBehaviorSource(SelectManyCheckboxListRenderer.java:214) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

          at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.decodeBehaviors(HtmlBasicRenderer.java:213) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

          at com.sun.faces.renderkit.html_basic.MenuRenderer.decode(MenuRenderer.java:221) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

          at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:787) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

          at javax.faces.component.UIInput.decode(UIInput.java:757) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

          at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1181) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

          at javax.faces.component.UIInput.processDecodes(UIInput.java:662) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

          at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1176) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

          at javax.faces.component.UIForm.processDecodes(UIForm.java:225) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

          at com.sun.faces.context.PartialViewContextImpl$PhaseAwareVisitCallback.visit(PartialViewContextImpl.java:506) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

          at com.sun.faces.component.visit.PartialVisitContext.invokeVisitCallback(PartialVisitContext.java:183) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

          at javax.faces.component.UIComponent.visitTree(UIComponent.java:1590) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

          at javax.faces.component.UIForm.visitTree(UIForm.java:335) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

          at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

          at javax.faces.component.UIComponent.visitTree(UIComponent.java:1601) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

          at com.sun.faces.context.PartialViewContextImpl.processComponents(PartialViewContextImpl.java:376) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

          at com.sun.faces.context.PartialViewContextImpl.processPartial(PartialViewContextImpl.java:252) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

          at javax.faces.context.PartialViewContextWrapper.processPartial(PartialViewContextWrapper.java:183) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

          at org.richfaces.context.ExtendedPartialViewContextImpl.processPartial(ExtendedPartialViewContextImpl.java:199) [richfaces-core-impl-4.1.0.CR2.jar:4.1.0.CR2]

          at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:931) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

          at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

          at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

          at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]

          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593) [jboss-jsf-api_2.1_spec-2.0.0.Final.jar:2.0.0.Final]

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.10.Final.jar:]

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]

          at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62) [weld-core-1.1.5.AS71.Final.jar:2012-02-10 15:31]

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]

          at org.jboss.solder.servlet.exception.CatchExceptionFilter.doFilter(CatchExceptionFilter.java:65) [solder-impl-3.1.0.Final.jar:3.1.0.Final]

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]

          at org.jboss.solder.servlet.event.ServletEventBridgeFilter.doFilter(ServletEventBridgeFilter.java:74) [solder-impl-3.1.0.Final.jar:3.1.0.Final]

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]

          at com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:126) [prettyfaces-jsf2-3.3.2.jar:]

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.10.Final.jar:]

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.10.Final.jar:]

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.10.Final.jar:]

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.10.Final.jar:]

          at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.0.Final.jar:7.1.0.Final]

          at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:154) [jboss-as-web-7.1.0.Final.jar:7.1.0.Final]

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.10.Final.jar:]

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.10.Final.jar:]

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.10.Final.jar:]

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.10.Final.jar:]

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.10.Final.jar:]

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.10.Final.jar:]

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.10.Final.jar:]

          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_01]

        • 1. Re: java.lang.StringIndexOutOfBoundsException jsf renderkit
          nimo stephan Master

          I cannot find the error. I only know that this code caused the stacktrace:

           

          {code}

          <h:form>

          <h:panelGroup id="area">

           

                        

                          <h:selectOneMenu required="true" value="#{bean.sel}" converter="javax.faces.Integer"

                          valueChangeListener="#{bean.listener1}">

                          <f:selectItems value="#{bean.values}" var="_o" itemLabel="#{_o.name}" itemValue="#{_o.id}"/>

                          <f:ajax render="area">

                          </h:selectOneMenu>

           

                          <h:selectOneRadio layout="pageDirection" id="this-makes-trouble"

                              value="#{bean.sel1}" valueChangeListener="#{bean.listener2}">

                              <f:selectItems value="#{bean.values2}"

                                  var="_o" itemLabel="#{_o.name}" itemValue="#{_o.name}" />

          <!-- STRANGLY, when deleting the following f:ajax-tag, then the stacktrace does not occur, but I need the ajax-tag ! -->

                             <f:ajax render="area">

                          </h:selectOneRadio>


          <h:commandLink value="Save"

                                  action="#{bean.save}">

                                  <f:ajax execute="@form"

                                      render="@form" />

                              </h:commandLink>

           

                          </h:panelGroup>

          </h:form>

          {code}

          The view is rendered fine but when submiting the form, the stacktrace above occurs.

           

          It is really strange, that when deleting the f:ajax-tag of component "this-makes-trouble", then the stacktrace/error does not occur - however, I need the ajax-tag within this component!

           

          What should I do? Is this a bug of JSF or Richfaces? I dont know.