0

I am using EJB 3.0 + JPA 2.0 + PrimeFaces 3.2 + JSF 2.0. The navigation in my application was great with no problems when I repeated the same code in every page. When I template.xhtml I used as a master page so that the same code applies to all pages, an error message comes:

javax.servlet.ServletException: Trying to extract rowIndex from clientId 'j_idt36:j_idt38:j_id2' For input string: "j_idt38"

This link show you when the error message rises: http://www.youtube.com/watch?v=rR6CqwBREpM

template.xhtml code :

<h:head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <script>
        window.history.forward();
    </script>
    <ui:insert name="title">
    </ui:insert>
    <link href="#{facesContext.externalContext.requestContextPath}/resources/css/cssLayout.css" rel="stylesheet" type="text/css"/>
</h:head>

<h:body>
    <f:view locale="#{langueApp.localeCode}">
        <p:layout fullPage="true">
            <p:layoutUnit position="north" size="100" header="#{bundle.header}" resizable="true" closable="false" collapsible="true">
                <ui:include src="template/header.xhtml"/>
            </p:layoutUnit>

            <p:layoutUnit position="west" size="300" resizable="true"  collapsible="true" header="#{bundle.me}" minSize="200">
                <ui:include src="template/dynamicmenu.xhtml"/>
            </p:layoutUnit>

            <ui:insert name="content">

            </ui:insert>

            <p:layoutUnit position="south" size="0" style="text-align: center;" header="#{bundle.footer}" resizable="false" closable="false" collapsible="false" >
                <ui:include src="template/footer.xhtml"/>
            </p:layoutUnit> 
        </p:layout>
    </f:view>
</h:body>

the stack trace :

Avertissement: PWC4011: Unable to set request character encoding to UTF-8 from context /ProjetIset2, because request parameters have already been read, or ServletRequest.getReader() has already been called
Avertissement: StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception
java.lang.NumberFormatException: Trying to extract rowIndex from clientId 'j_idt36:j_idt38:j_id2' For input string: "j_idt38"
    at javax.faces.component.UIData.invokeOnComponent(UIData.java:1006)
    at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1403)
    at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:669)
    at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1403)
    at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:669)
    at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1403)
    at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:669)
    at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1403)
    at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:669)
    at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1403)
    at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:669)
    at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:305)
    at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:188)
    at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:123)
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:452)
    at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:148)
    at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:303)
    at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:192)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1539)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
    at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:330)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
    at java.lang.Thread.run(Thread.java:722)
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Taieb Baccouche
  • 217
  • 3
  • 7
  • 21
  • Please post here a full stack trace. So we can see a cause of ServletException. – DRCB May 23 '12 at 10:17
  • I changed my position by adding the stack trace – Taieb Baccouche May 23 '12 at 10:26
  • the h:body should be inside the f:view tag, but anyways that is not the root of the error. Does the error come up on every page using the template? or only in a specific page? you can try using a blank template client so that we can know for sure the error is in the template. Also you can try to add ids to your components so we can know which components are "j_idt36:j_idt38:j_id2" and "j_idt38". – damian May 23 '12 at 13:10
  • the dynamic menu and the accordion menu have caused the problem. I added an id for each component and also for form and now all is well. thank you very much for your help. – Taieb Baccouche May 23 '12 at 13:51
  • 2
    If you found the answer yourself, you are eligible to post it as a normal answer (and accept it). – BalusC May 24 '12 at 03:58

1 Answers1

2

I think this is a bug in Mojarra implementation. I traced down to the error in code and fired a bug: http://java.net/jira/browse/JAVASERVERFACES-2623

jason zhang
  • 633
  • 6
  • 13