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.
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.
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?
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.
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)?
Does this still happen? If not we should close this report ...
(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?
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.
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.