Simple JSF Java EE 7 Web app encounters ViewExpiredException while debugging

Environment:

Ubuntu 13.10 64 bit
Java 8
IntelliJ IDEA 13.1.2
Java EE 7
Wildfly 8.1 CR1
Google Chrome

I've created a simple JSF enabled web app using a Maven Archetype to test some Websocket functionality.  When running the application and selecting a command button that executes ajax, I receive the exception:

[31m13:27:08,093 SEVERE [javax.enterprise.resource.webcontainer.jsf.context] (default task-3) javax.faces.application.ViewExpiredException: viewId:/index.xhtml - View /index.xhtml could not be restored.
 at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:210)
 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 io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
 at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)
 at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
 at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
 at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
 at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113)
 at io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52)
 at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)
 at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61)
 at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)
 at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
 at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
 at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
 at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
 at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
 at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240)
 at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)
 at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73)
 at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146)
 at io.undertow.server.Connectors.executeRootHandler(Connectors.java:168)
 at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:687)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 at java.lang.Thread.run(Thread.java:745)


Deploying the application directly on wildfly does not exhibit the problem.  

Is anyone else having this problem?  I would really like to purchase a license for this IDE but right now I can't even debug a test application on it.

Thanks in advance.

2 comments

I can only guess of course, but probably session timeout in your application is relatively short (as is in my application for testing purposes) and when you debug application (especially if you go step by step) the session may be invalid before you hit the button executing AJAX request. I have similar application (Spring MVC + JSF + PrimeFaces) and I can debug it without any issues.

BTW As far as I know, the problem with ViewExpiredException is something you have to deal with anyway - whether you run application from IDE or manually deploy it to an application server. Take a look at those two discussion for possible solutions:

0

Hi Daniel, I appreciate your response but unfortunately this isn't the case.  The session timeout is set to 30 minutes and the application works perfectly fine when I deploy it directly (not through the IDE).  The application also works no problem using Netbeans through the debugger.  This is definitely an issue with the IDE in combination with my machine/Java version/etc.  It really is too bad since IDEA 13 looks so much nicer than Netbeans and seems to have better integration with deployment on Wildfly (minus the fact the debugger isn't functioning correctly).

0

Please sign in to leave a comment.