Exception while restoreView, only on android client...

UI Components for JSF
Post Reply
LaurentM
Posts: 8
Joined: 26 Nov 2014, 18:40

26 Nov 2014, 19:50

Hi.

I'm new on primefaces. I try to read the generated page on an old company's terminal with android 2.3.4 embedded.


When i try on my computer (windows7) or on an terminal with windows XP, there is no problem (except my own failures ^^).

But on the android terminal, i have got lots of problems.
The application is included in jsp page thanks to a <iframe ...>. The first time, there is no problem.
But where i close the contener and open it again, i have an indexOutOfBoundException between my first and my second page.

I trashed all the code (except one button on the first page and a inputText on the second) and the exception still appears....

I have to reboot the terminal to solve the problem one time but this solution can't be used in production...
Before to trash all, i had invalidate the session, no change....

GRAVE: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at javax.faces.component.AttachedObjectListHolder.restoreState(AttachedObjectListHolder.java:166)
at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1611)
at com.sun.faces.application.view.FaceletPartialStateManagementStrategy$2.visit(FaceletPartialStateManagementStrategy.java:380)
at com.sun.faces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:151)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1689)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700)
at javax.faces.component.UIComponent.visitTree(UIComponent.java:1700)
at com.sun.faces.application.view.FaceletPartialStateManagementStrategy.restoreView(FaceletPartialStateManagementStrategy.java:367)
at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:138)
at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:123)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:585)
at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:150)
at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:353)
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:197)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:121)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:301)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:136)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1015)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:652)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1575)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1533)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


First page:

Code: Select all

        <h:form id="configControlForm" >
            <p:commandButton value="Valider" action="controlMeasures"/>
            <p:messages id="messages" showDetail="true" autoUpdate="true" showSummary="false"/>
        </h:form>

Second page:

Code: Select all

    <h:body>
        <h:outputStylesheet library="default" name="css/style.css"></h:outputStylesheet>
        <h:form id="formControl">
	        
 <p:inputText></p:inputText>
		   
        </h:form>
        
I have not embedded debugger and can't read the generated page on the terminal.
I'm wondering if it coud be a compatibility issue? (embedded javascript engine? embedded web browser?...)

Server configuration:
Windows 7
Eclipse Luna 4.4.1
primefaces-5.1
javax.faces-2.2.8-03
apache 8.0.3
JDK 1.7


I also have some unavailable components. For exemple, the virtual keyboard seems to be replaced by a simple inputText.
primefaces-5.1 / javax.faces-2.2.8-03
server : Windows 7
client: android 2.3.4
Eclipse Luna 4.4.1 / JDK 1.7
apache 8.0.3

User avatar
andyba
Expert Member
Posts: 2473
Joined: 31 Mar 2011, 16:27
Location: Steinfeld, near Bremen/Osnabrück, DE
Contact:

27 Nov 2014, 12:09

Are you using PrimeFaces Mobile?
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

27 Nov 2014, 12:25

and there isn't even a primefaces error in the stacktrace

LaurentM
Posts: 8
Joined: 26 Nov 2014, 18:40

27 Nov 2014, 12:33

I haven't found how to swith to primesfaces Mobile.

I tried to add <f:view renderKitId="PRIMEFACES_MOBILE" /> (as seen in the show case) but in this case i have lots of other problems.

On windows i have data and buttons in my datatable but i just got the text of the page selector with no style apply and no action available on it.

On Android terminal i got the following error:
error on line 44 at column 61: attribute type redefined.
The component is a <p:panelGrid>. If i remove it, I got the same problem on a <p:grid>.


I don't know if there is something else to do. I don't remember if I had added the <pm:page> <pm:header> <pm:content> tag (i think i had), but all my tests had no effect so i removed all changes.
primefaces-5.1 / javax.faces-2.2.8-03
server : Windows 7
client: android 2.3.4
Eclipse Luna 4.4.1 / JDK 1.7
apache 8.0.3

User avatar
andyba
Expert Member
Posts: 2473
Joined: 31 Mar 2011, 16:27
Location: Steinfeld, near Bremen/Osnabrück, DE
Contact:

27 Nov 2014, 12:40

If the application is for mobile devices only then only use PrimeFaces mobile.
If you are creating an application for both then things get complicated.
PF 4.x (Elite versions), PF 5, Pf 5.1, PF 6.0
Glassfish 4.1, Mojarra 2.x, Java 8, Payara 4.1.1.
If you haven't read the forum rules read them now

LaurentM
Posts: 8
Joined: 26 Nov 2014, 18:40

27 Nov 2014, 13:14

So what shoud i have to do to change my application to primeface mobile?

- Add the <f:view renderKitId="PRIMEFACES_MOBILE" /> <pm:page> <pm:header> <pm:content> tags.
- Only use components shown in the mobile showcase.
- my application contains the primefaces-5.1.jar and javax-faces-2.2.8-03.jar

I don't used maven so I can't get the dependency on org.primefaces|mobile|0.9.0 as seens on the primefaces_mobile_user_guide_0_9.pdf (is there a newer version of the documentation).

Writting this post i just thought to explore the repository manually. I found the primefaces-mobile-0.9.4.jar. Is it the lastest stable version?
There is no download section for primefaces-mobile so i thought it is now included in the primefaces-5.1.jar.

Is there something else i forgot?
primefaces-5.1 / javax.faces-2.2.8-03
server : Windows 7
client: android 2.3.4
Eclipse Luna 4.4.1 / JDK 1.7
apache 8.0.3

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

27 Nov 2014, 14:44

Could you please try to use h:commandButton with a attached f:ajax instead of p:commandButton?

I'm sure the exception is not related to primefaces.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

LaurentM
Posts: 8
Joined: 26 Nov 2014, 18:40

27 Nov 2014, 15:16

So, i just made some more tests.
With a <h:commandButton> I have no problem.

But this time I trashed all my java classes (not only the page content) and in this case it works with both tags.

I will add my backing beans one by one and found which one is the problem source.


PS: I'm still interessed by answer about primefaces-mobile.
primefaces-5.1 / javax.faces-2.2.8-03
server : Windows 7
client: android 2.3.4
Eclipse Luna 4.4.1 / JDK 1.7
apache 8.0.3

LaurentM
Posts: 8
Joined: 26 Nov 2014, 18:40

01 Dec 2014, 11:35

So, i forgot to update this topic...

Finally, the problems seem to come from my xhtml file.
Depending on tests, sometime I removed few lines from my first page, sometime not. If one of them lefts the program crash.

It seems strange because some of them came from showcase....
...
<h:head>
<title>Facelet Title</title>
</h:head>
<h:outputStylesheet library="default" name="css/style.css"></h:outputStylesheet>
Hello from Facelets
<br />
<br />

...
<p:commandButton value="Valider" action="controleMesures"/>
<!-- <p:commandButton value="Valider" action="controleMesures"/> -->
<!-- <p:button value="Valider" outcome="controleMesures" onclick=""/> -->

...
I just hope it is not a side effect, not triggered since i remove those lines but still here.
primefaces-5.1 / javax.faces-2.2.8-03
server : Windows 7
client: android 2.3.4
Eclipse Luna 4.4.1 / JDK 1.7
apache 8.0.3

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

01 Dec 2014, 11:51


Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 34 guests