This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 171912 - ViewExpiredException with JSF
Summary: ViewExpiredException with JSF
Status: NEW
Alias: None
Product: javaee
Classification: Unclassified
Component: JSF (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Martin Fousek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-10 12:38 UTC by David Strupl
Modified: 2013-01-28 07:15 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Strupl 2009-09-10 12:38:42 UTC
1. Create a web app with glassfish v3
2. run it
3. go to lunch
4. return from lunch
5. try to continue the running session
6. WARNING: StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception
javax.faces.application.ViewExpiredException: viewId:/test1/uziv/Edit.xhtml - View /test1/uziv/Edit.xhtml could not be
restored.
        at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:212)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
        at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:110)
        at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:310)
        at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1522)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:293)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
        at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:342)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:238)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:209)
        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:752)
        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:660)
        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:911)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:164)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
        at com.sun.grizzly.util.FixedThreadPool$BasicWorker.dowork(FixedThreadPool.java:379)
        at com.sun.grizzly.util.FixedThreadPool$BasicWorker.run(FixedThreadPool.java:360)
        at java.lang.Thread.run(Thread.java:619)
in the server log.

The developer should be somehow hinted how to gracefully handle this as it can easily happen for the web app end user.
Most probably it is documented somewhere but the IDE might help with dealing with this.
Comment 1 Petr Jiricka 2009-09-11 15:08:39 UTC
Interesting - sounds like this will be a common situations developers need to deal with. How should it be addressed?
1. JSF implementation?
2. GlassFish?
3. Application code? Should the IDE have some features that help users deal with this?
Comment 2 David Konecny 2009-09-13 22:06:34 UTC
In old time when I used to write Struts applications for a bank we have used Struts's <global-exceptions> to define a
list of exceptions and mapped them to some error page. And ViewExpiredException is good example of an exception which
should be handled by web application to show a specific page saying "you have not used the app for as while and session
expired blahblah click here to re-login".

Perhaps below exception message should be slightly more explicit and say "...could not be restored BECAUSE session
expired" or something like that.
Comment 3 David Strupl 2009-09-14 08:37:03 UTC
Can we add some hint somewhere for the user that would help him to configure the web app to handle this gracefully? BTW
if there will be no web.xml where this would be configured (and how)?
Comment 4 David Strupl 2013-01-23 20:34:58 UTC
Does this still happen? If not we should close this report ...
Comment 5 Martin Fousek 2013-01-24 08:30:21 UTC
(In reply to comment #4)
> Does this still happen? If not we should close this report ...

Yes, this can still happen when i.e. your session expired. The easiest way would be to create error page and register it in the web.xml DD.

But the question is where should be the hint displayed? In the web.xml? But it mustn't exist at all since EE6+ (servlet 3.0). So the hint wouldn't be probably the best idea. We could create simple wizard "Error Page Handler"  in JSF or better Web category which would create JSP or Facelet page with the warning and it would register it into the web.xml deployment descriptor. What do you think?
Comment 6 edburns 2013-01-24 13:19:44 UTC
An error page wizard seems very useful and has potential for growth.  For example, the it could aid in using the ExceptionHandler facility from JSF 2.0.  I like it.
Comment 7 Martin Fousek 2013-01-28 07:15:26 UTC
Let's turn it into enhancement since the code doesn't contain real bug but more something like hint or similarly is missing and setup higher priority to don't get it lost in pack of the rest improvements since it looks useful to generate also for real apps.