Hi, Leonardo!

Unfortunately, I've been very pressed by having to get it to work in production, so I switched this project to Majorra. Happily enough, the error didn't appear anymore, at least until now.

I would have definitely loved to afford doing those tests, but it wasn't possible unfortunately. Anyway, by the fact that now it doesn't appear just by changin to Majorra, it is obvious that there might be a hidden little bug somewhere in MyFaces, otherwise it can't be explained.

I'm so sorry that I can't reproduce it. It happened completely random. It might be as you suggested, a problem in creating/reloading the state. You know better than me those details.

I would really like to have that bug discovered and fixed, because I was quite used to MyFaces.
Thank you again for trying to help.
I hope something can be done about it. I know that, without being able to reproduce it, it's a little bit hard, but I hope.

Best,
Mircea

On 9/27/2013 11:56 AM, Leonardo Uribe wrote:
Hi

There is no magical solutions to you problem. You should check which value
has javax.faces.ViewState request parameter in the POST request that causes
the ViewExpiredException. Put a filter or a PhaseListener that logs that
value when there is an incoming request to that view. The key point is to
know if the view state token is there or not and if it has been altered
somehow between the time the page is renderer and the time the button is
clicked and the POST is sended. You need to log the token saved on the page
too, to know the original value.

One option I can imagine is that the value in the ViewState token is sent
partially. The server received the trimmed token, it doesn't match because
it is broken and it throws correctly the ViewExpiredException. But sounds
unlikely, we need more evidence about what's going on.

What I can say is the code in MyFaces Core is ok in that part and
specifically the state management code has been tested exhaustively. It is
quite unlikely to find a bug in that part.

regards,

Leonardo Uribe



2013/9/27 Zmirc <[email protected]>

Hi again!

Any ideas / fixes for this bug?
It's still there and is completely random.
Moreover, I can't reproduce it.

Please don't ignore it, because it's a real pain in the ...
It's screwing up the whole project, because some users get this bug
randomly, whenever they execute a post (command button).

Thank you so so much in advance.


On 9/25/2013 12:17 PM, Zmirc wrote:

Hi!
Some users (few) of the app I work on experience a very strange error,
which I can't yet reproduce.
Moreover, it appears in less than 10~ of executions.

Error: No saved view state could be found for the view identifier:
/mypage.xhtml

Application server: Apache Tomee 1.5.2 stable / 1.6.0-2013.09.20 dev (It
happens on both). I use the MyFaces distribution that comes with each of
them, so 2.1.10 / 2.1.12, so nothing new added.

Part of web.xml
|<context-param>
          <param-name>org.apache.**myfaces.USE_ENCRYPTION</param-**name>
          <param-value>false</param-**value>
        </context-param>
        <context-param>
          <param-name>javax.faces.STATE_**SAVING_METHOD</param-name>
          <param-value>client</param-**value>
        </context-param>|

So, no state view exception shouldn't happen, because state is on client.
It was set on server before, but I thought maybe client will fix it, but
nothing. There was actually no difference in the occurrence of that error.
Moreover, it's not related to deploy/redeploy/restart, because encryption
is false. I don't experience any problem with that.

Execution flow:
1. Client opens xhtml page (JSF).
2. Client clicks on an command button to do various things, button
connected to a public void method of a JSF @ViewScoped ManagedBean.
3. Yes, the method is void because I don't need to return a String to
redirect to another page. I need to redirect to /page/id (example:
/market/24, /profile/43), therefore methods that return a String as
navigation destinations are useless, because I use:|FacesContext.**
getCurrentInstance().**getExternalContext().redirect(**path);|
4. In ~90% of the cases, everything works perfectly and users are
redirected to each specific page. In the rest of ~10 (randomly), they
get|No saved view state could be found for the view identifier:
/pagename.xhtml
|Basically, the command button's method is not executed.

I would really appreciate some help here, because I have no idea how to
get it fixed.
Thanks a lot in advance.

/*Session timeout is set to 30 days in web.xml (302400). The error
happens at random times for random users, but all users didn't use the
system yet for 30 days, so it's a little bit strange.*/

I use PrimeFaces and I also have a couple of my own filters in web.xml,
but that shouldn't be a problem, I hope so.

Any ideas please? I really don't know what to do in order to fix it.
Thanks a lot in advance.
It's on StackOverflow also: http://stackoverflow.com/**
questions/18992241/random-jsf-**error-no-saved-view-state-**
could-be-found/18999855<http://stackoverflow.com/questions/18992241/random-jsf-error-no-saved-view-state-could-be-found/18999855>

Stack trace for one of the pages:

|25-Sep-2013  07:39:26.380  SEVERE[http-bio-80-exec-15]
  org.apache.catalina.core.**StandardWrapperValve.invoke
   Servlet.service()
   for  servlet[Faces  Servlet]  in  contextwith  path[]  threw
exception[/dashboard/edit-**profile.xhtmlNo saved view state could be
foundfor  the view identifier:  /dashboard/edit-profile.xhtml]  with  root
cause
   javax.faces.application.**ViewExpiredException:
  /dashboard/edit-profile.**xhtmlNo saved view state could be foundfor
  the view identifier:  /dashboard/edit-profile.xhtml
          at org.apache.myfaces
.lifecycle.RestoreViewExe
cutor.execute(RestoreView
Executor.java:132)
          at org.apache.myfaces
.lifecycle.LifecycleImpl<
/span>.executePhase(**LifecycleImp
l.java:170)
          at org.apache.myfaces
.lifecycle.LifecycleImpl<
/span>.execute(LifecycleImpl.**java:117)
          at javax.faces.webapp
.FacesServlet.service(**FacesServlet.java:197)
          at org.apache.catalin
a.core.ApplicationFilterC
hain.internalDoFilter(App
licationFilterChain.java:305
)
          at org.apache.catalin
a.core.ApplicationFilterC
hain.doFilter(Application
FilterChain.java:210<
span class="pun" style="margin: 0px; padding: 0px; border: 0px;
font-size: 14px; vertical-align: baseline; background-color: transparent;
color: rgb(0, 0, 0); background-position: initial initial;
background-repeat: initial initial;">)
          at org.primefaces.web
app.filter.FileUploadFilt
er.doFilter(FileUploadFil
ter.java:77)
          at org.apache.catalin
a.core.ApplicationFilterC
hain.internalDoFilter(App
licationFilterChain.java:243
)
          at org.apache.catalin
a.core.ApplicationFilterC
hain.doFilter(Application
FilterChain.java:210<
span class="pun" style="margin: 0px; padding: 0px; border: 0px;
font-size: 14px; vertical-align: baseline; background-color: transparent;
color: rgb(0, 0, 0); background-position: initial initial;
background-repeat: initial initial;">)
          at org.ocpsoft.rewrit
e.servlet.RewriteFilter.**doFilter(RewriteFilter.java:**199)
          at org.apache.catalin
a.core.ApplicationFilterC
hain.internalDoFilter(App
licationFilterChain.java:243
)
          at org.apache.catalin
a.core.ApplicationFilterC
hain.doFilter(Application
FilterChain.java:210<
span class="pun" style="margin: 0px; padding: 0px; border: 0px;
font-size: 14px; vertical-align: baseline; background-color: transparent;
color: rgb(0, 0, 0); background-position: initial initial;
background-repeat: initial initial;">)
          at com.pingushare.bou
ndary.filter.ActivateAcco
untFilter.doFilter(Activa
teAccountFilter.java:37)
          at org.apache.catalin
a.core.ApplicationFilterC
hain.internalDoFilter(App
licationFilterChain.java:243
)
          at org.apache.catalin
a.core.ApplicationFilterC
hain.doFilter(Application
FilterChain.java:210<
span class="pun" style="margin: 0px; padding: 0px; border: 0px;
font-size: 14px; vertical-align: baseline; background-color: transparent;
color: rgb(0, 0, 0); background-position: initial initial;
background-repeat: initial initial;">)
          at com.pingushare.bou
ndary.filter.SecurityFilt
er.doFilter(SecurityFilte
r.java:36)
          at org.apache.catalin
a.core.ApplicationFilterC
hain.internalDoFilter(App
licationFilterChain.java:243
)
          at org.apache.catalin
a.core.ApplicationFilterC
hain.doFilter(Application
FilterChain.java:210<
span class="pun" style="margin: 0px; padding: 0px; border: 0px;
font-size: 14px; vertical-align: baseline; background-color: transparent;
color: rgb(0, 0, 0); background-position: initial initial;
background-repeat: initial initial;">)
          at com.pingushare.bou
ndary.filter.ForceFreshPa
geAndWWWFilter.doFilter(F
orceFreshPageAndWWWFilter.**java:49)
          at org.apache.catalin
a.core.ApplicationFilterC
hain.internalDoFilter(App
licationFilterChain.java:243
)
          at org.apache.catalin
a.core.ApplicationFilterC
hain.doFilter(Application
FilterChain.java:210<
span class="pun" style="margin: 0px; padding: 0px; border: 0px;
font-size: 14px; vertical-align: baseline; background-color: transparent;
color: rgb(0, 0, 0); background-position: initial initial;
background-repeat: initial initial;">)
          at org.apache.catalin
a.core.StandardWrapperVal
ve.invoke(StandardWrapper
Valve.java:222)
          at org.apache.catalin
a.core.StandardContextVal
ve.invoke(StandardContext

Valve.java:123)
          at org.apache.tomee.catalina.**OpenEJBValve.invoke(**
OpenEJBValve.java:45)
          at org.apache.catalin
a.authenticator.Authentic
atorBase.invoke(Authentic
atorBase.java:502)
          at org.apache.catalin
a.core.StandardHostValve<
/span>.invoke(**StandardHostValve<
/span>.java:171)
          at org.apache.catalin
a.valves.ErrorReportValve
.invoke(ErrorReportValve<
/span>.java:99)
          at org.apache.catalin
a.valves.AccessLogValve.**invoke(AccessLogValve.java:**953)
          at org.apache.catalin
a.core.StandardEngineValv
e.invoke(StandardEngineVa
lve.java:118)
          at org.apache.catalin
a.connector.CoyoteAdapter
.service(CoyoteAdapter.java:**408)
          at org.apache.coyote<
/span>.http11.**AbstractHttp11Proc
essor.process(AbstractHtt
p11Processor.java:1023)
          at org.apache.coyote<
/span>.AbstractProtocol$**AbstractConnectionHandler.**
process(AbstractProtocol.java:**589)
          at org.apache.tomcat<
/span>.util.net.JIoEndpoint$**SocketProcessor.run(**JIoEndpoint.java:312)
          at java.util.concurre
nt.ThreadPoolExecutor.run
Worker(ThreadPoolExecutor.**java:1145)
          at java.util.concurre
nt.ThreadPoolExecutor$Worker.**run(ThreadPoolExecutor.java:**615)
          at java.lang.Thr
ead.run(Thread.java:724)|



Reply via email to