[JBoss Seam] - Re: Logout problem
by dnikolic
Try this:
| import javax.faces.context.FacesContext;
| import javax.servlet.http.Cookie;
| import javax.servlet.http.HttpServletRequest;
| import javax.servlet.http.HttpServletResponse;
|
| import org.acegisecurity.context.SecurityContextHolder;
| import org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices;
| import org.jboss.seam.Seam;
|
|
| ...
|
| private void logoutAuthentication() {
| HttpServletRequest request =
| (HttpServletRequest)FacesContext.getCurrentInstance()
| .getExternalContext().getRequest();
| HttpServletResponse response = (HttpServletResponse)FacesContext.getCurrentInstance()
| .getExternalContext().getResponse();
| try {
| if (request.getRemoteUser() != null) {
| Seam.invalidateSession(); // invalidate session
| Cookie terminate = new Cookie(TokenBasedRememberMeServices
| .ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY, null);
| terminate.setMaxAge(0);
| terminate.setPath("/"); // You need to add this!!!!!
| response.addCookie(terminate);
| SecurityContextHolder.clearContext(); // invalidate
| // authentication
| }
|
| } catch (Exception e) {
| log.error("Error logging out: ", e);
| }
| log.debug("SecurityContext invalidated!");
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093559#4093559
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093559
18Â years, 8Â months
[JBoss Seam] - Getting a runtime exception while deploying app.
by deepsix
Hi, apologies if the question is silly..
I am new to seam and trying to create my own application using seam. .
Whenever i deploy the application, i get the following runtime exception..
Any ideas what jar i am missing referring to?
exception
javax.servlet.ServletException: Servlet execution threw an exception
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
root cause
java.lang.NoClassDefFoundError: org/jboss/el/lang/EvaluationContext
org.jboss.seam.jsf.SeamApplication.getExpressionFactory(SeamApplication.java:346)
com.sun.facelets.compiler.Compiler.createExpressionFactory(Compiler.java:131)
com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:198)
com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:144)
com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:95)
com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:517)
com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093551#4093551
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093551
18Â years, 8Â months
[EJB 3.0] - Re: Passivation-can its time of occurance be controlled?(4.2
by konkimalla
Thanks for the timely response as this was critical. I started with testing by adding the annotation and it works fine. Then, removed the code and edited the xml file and even then it works fine (no passivation). I edited the file both in clustered/nonclustered and passivation is being stopped.
However, I am not sure the editing of the xml file will cause other problems. Following are the changes I made.
1) First test: stopping passivation for all beans. Added the following lines to domain = "Stateful Bean".
anonymous wrote : '<'annotation expr="!class((a)org.jboss.annotation.ejb.cache.Cache)">
| @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.NoPassivationCache.class)
| '<'/annotation>
2) Second test: stopping passivation for a specific bean (only one stateful bean in def package) . Added the following lines to domain = "Stateful Bean".
anonymous wrote : '<'annotation expr="!class((a)com.aaa.bbb.ccc.def.*)">
| @org.jboss.annotation.ejb.cache.Cache (org.jboss.ejb3.cache.NoPassivationCache.class)
| '<'/annotation>
Can you please confirm the correctness of the changes made to the xml file?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4093547#4093547
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4093547
18Â years, 8Â months