voyent
Session Timeout - Again  XML
Forum Index -> General Help Go to Page: Previous  1, 2, 3 Next 
Author Message
alin.costea


Joined: 22/Dec/2008 00:00:00
Messages: 52
Offline


I'm having the same problem, my application UI freezes on session expiration (ICEfaces 2.0.1 on Glassfish 3.1). I tried:
Code:
     <context-param>
         <param-name>org.icefaces.lazyPush</param-name>
         <param-value>false</param-value>
     </context-param>
     <context-param>
          <param-name>org.icefaces.strictSessionTimeout</param-name>
          <param-value>true</param-value>
      </context-param>
     <context-param>
         <param-name>org.icefaces.sessionExpiredRedirectURI</param-name>
         <param-value>/Pages/User/Login.jsf</param-value>
     </context-param>
 
     PushRenderer.addCurrentSession("session-expiry");
 



but the result is the same: UI lock

The JS issues I see in Firebug are:

Code:
 [window] the response does not contain XML data
 [window] Error [status: emptyResponse code: 200]: An empty response was received from the server. Check server error logs.
 (?)(self=self(operator), category=["window"], message="Error [status: emptyRes...heck server error logs.", exception=undefined)bridge...0516894 (line 1224)
 operator()bridge...0516894 (line 184)
 (?)(self=self(operator), operation=function(), category=["window"], message="Error [status: emptyRes...heck server error logs.", exception=undefined)bridge...0516894 (line 1264)
 operator()bridge...0516894 (line 184)
 Logger(self=self(operator), message="Error [status: emptyRes...heck server error logs.", exception=undefined)bridge...0516894 (line 1182)
 operator()bridge...0516894 (line 184)
 (?)(e=Object { type="error", status="emptyResponse", more...})bridge...0516894 (line 2085)
 sendError(request=XMLHttpRequest { responseText="<!DOCTYPE HTML PUBLIC "..."></div></body>\n</html>", mozResponseArrayBuffer=ArrayBuffer, more...}, context=Object { sourceid=form#vbf468u3, onerror=false, more...}, status="emptyResponse", description=undefined, serverErrorName=undefined, serverErrorMessage=undefined)jsf.js...lopment (line 1389)
 response(request=XMLHttpRequest { responseText="<!DOCTYPE HTML PUBLIC "..."></div></body>\n</html>", mozResponseArrayBuffer=ArrayBuffer, more...}, context=Object { sourceid=form#vbf468u3, onerror=false, more...})jsf.js...lopment (line 1999)
 onComplete()jsf.js...lopment (line 1215)
 onreadystatechange()jsf.js...lopment (line 1196)
 exception ? console.er...ror(formatOutput(category, message)); 
 
ppllaxxa

Joined: 10/Feb/2011 23:32:41
Messages: 1
Offline


Hi. I have same problem. Can someone help with this?
alin.costea


Joined: 22/Dec/2008 00:00:00
Messages: 52
Offline


No clean solution yet...
banitz

Joined: 27/Dec/2008 00:00:00
Messages: 2
Offline


I have found a work around

You must create a phase filter like this


package tv.arte.banitz.artepro;
import javax.faces.FacesException;
import javax.faces.application.Application;
import javax.faces.application.ViewHandler;
import javax.faces.component.UIViewRoot;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
import javax.servlet.http.HttpSession;

@SuppressWarnings("serial")
public class filterSessionTimeout implements PhaseListener {


public void afterPhase(PhaseEvent event) {
//Do anything
}


public void beforePhase(PhaseEvent event) {
System.out.println("phase");
FacesContext context = event.getFacesContext();
ExternalContext ext = context.getExternalContext();
HttpSession session = (HttpSession) ext.getSession(false);
boolean newSession = (session == null) || (session.isNew());
boolean postback = !ext.getRequestParameterMap().isEmpty();
boolean timedout = postback && newSession;
if (timedout) {
System.out.println("timeout");
Application app = context.getApplication();
ViewHandler viewHandler = app.getViewHandler();
UIViewRoot view = viewHandler.createView(context, "/sessionTimeOut.xhtml" );
context.setViewRoot(view);
context.renderResponse();
try {
viewHandler.renderView(context, view);
context.responseComplete();
} catch (Throwable t) {
throw new FacesException("Session timed out", t);
}
}
}


public PhaseId getPhaseId() {
return PhaseId.RESTORE_VIEW;
}
}

in this example "/sessionTimeOut.xhtml" is the page to which you are redirected when a time out occurs


Your must register this filter in face-config.xml

<lifecycle>
<phase-listener>tv.arte.banitz.artepro.filterSessionTimeout</phase-listener>
</lifecycle>

the redirected page must contain a button that reload the page like this :



ice:commandButton type="button" value="ok, weiter zu home Seite" onclick="window.location.reload()"

kweem

Joined: 23/Apr/2008 00:00:00
Messages: 3
Offline


I'm experiencing the same behavior. The proposed solution of a custom redirect phaselistener does not work for me.

Did someone already found a workaround or know when this bug will be resolved ?
alin.costea


Joined: 22/Dec/2008 00:00:00
Messages: 52
Offline


Nothing yet on this front, I'm having Session Expiration problems with AjaxPush as well (on application start the session expired popup appears on the first push).

Note: The AjaxPush is triggered by a JMS message listener so that could be one of the reasons.
jbrice

Joined: 02/Mar/2011 19:19:37
Messages: 16
Offline


Hi everybody,

I get the same problem as well, after a session timeout, the application becomes unresponsive, thus, the links no longer work, the entire application is frozen!!!
HELPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Raska2000

Joined: 13/Jan/2011 03:13:13
Messages: 1
Offline


Hi everybody,

i have the same problem that my application is frozen after session expired.

Has anyone any further idea ???
Is this a bug in icefaces 2.0.2 ????
iain.ibo

Joined: 14/Mar/2011 06:43:47
Messages: 4
Offline


I'm experiencing the same issue using ice faces 2.0.2.

I have the following entry in my web.xml

Code:
  
 <context-param>
     <param-name>org.icefaces.sessionExpiredRedirectURI</param-name>
  	<param-value>/resources/Logout.jsp</param-value>
   </context-param>
 


Interestingly if I set the timeout to be:

Code:
   <session-config>
         <session-timeout>30</session-timeout>
   </session-config>
 


Everything works fine. However if I extend this up to an hour, which is the value I need then the app becomes completely unresponsive. I can see the following error using firebug:


[window] error [status: emptyresponse code: 200]: an empty response was received from the server.
 


What timeouts do the other people who are experiencing this have set?

I know it's been said but if anyone has found a way round this it would be awesome to hear it! I'll update if I make any further progress.
jbrice

Joined: 02/Mar/2011 19:19:37
Messages: 16
Offline


Whether I set session timeout to 30, it doesnt work either, for me!

jbrice

Joined: 02/Mar/2011 19:19:37
Messages: 16
Offline


Which version of spring security are you using?
I'm using the old one 2.0.4, may be the 3.1 could fix the problem?
Unvirtual

Joined: 02/Jan/2009 00:00:00
Messages: 151
Offline


Have you tried raising up to a really much higher level?
Default is round about 10 minutes, you can raise it without problems up to two weeks.

Code:
     <context-param>
         <param-name>com.sun.faces.defaultResourceMaxAge</param-name>
         <param-value>604800</param-value>
     </context-param>
 
dspeed

Joined: 04/Mar/2011 03:32:32
Messages: 10
Offline


Hey,

We have had the same problem as most of you where the app freezes when the session expires.

Banitz solution above didn't quite work for us but I have managed to modify it so that it does (or seems to).

We changed Banitz's original beforePhase method in his PhaseListener to


public void beforePhase(PhaseEvent event) {
FacesContext context = event.getFacesContext();
ExternalContext ext = context.getExternalContext();
Map<String, Object> sessionMap = ext.getSessionMap();
HttpSession session = (HttpSession) ext.getSession(false);
Boolean newSession = (sessionMap == null) || (sessionMap.isEmpty()) && (! session.isNew());
Boolean timedout = newSession;
if (timedout) {
Application app = context.getApplication();
ViewHandler viewHandler = app.getViewHandler();
UIViewRoot view = viewHandler.createView(context, "/vendexpert-login/.xhtml" );
context.setViewRoot(view);
context.renderResponse();
try {
viewHandler.renderView(context, view);
context.responseComplete();
} catch (Throwable t) {
throw new FacesException("Session timed out", t);
}
}

}
 


We didn't have to add the onclick code to the button either.

In my limited tests so far when the session expires our app now pops up a 'network disconnected press here to reload' message box which when the button is clicked loads our login page.

I'm fairly new to JSF / Icefaces so I'd be interested in hearing from people who know better if this solution is acceptable / I haven't removed anything important from Banitz's original code.

Thanks to everyone in this thread for the help you provided.
iain.ibo

Joined: 14/Mar/2011 06:43:47
Messages: 4
Offline


I don't use Spring security I'm afraid, I'm using Tomcat Single Sign On:
[url]
http://tomcat.apache.org/tomcat-5.5-doc/config/host.html#Single_Sign_On
[/url]
iain.ibo

Joined: 14/Mar/2011 06:43:47
Messages: 4
Offline


Thanks dspeed

I'll give your modification of Banitz solution a go and let you know how I get on.

Thanks again.
 
Forum Index -> General Help Go to Page: Previous  1, 2, 3 Next 
Go to:   
Powered by JForum 2.1.7ice © JForum Team