2014-01-23 3 views
2

나는 콩 방법이 잘 작동JSF 로그 아웃 내 응용 프로그램에서

public String logout(){ 
    FacesContext.getCurrentInstance().getExternalContext().invalidateSession(); 
    return Navigator.goTo("/index.xhtml"); 
} 

에게 전화를 로그 아웃 버튼으로 상단 바있다, 그러나 나는이 예외와 함께 실패 특정 페이지가

2014-01-23T15:17:42.405+0100|WARNING: StandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception 
java.lang.NullPointerException 
    at org.jboss.weld.context.beanstore.http.AbstractSessionBeanStore.getLockStore(AbstractSessionBeanStore.java:120) 
    at org.jboss.weld.context.beanstore.AttributeBeanStore.lock(AttributeBeanStore.java:219) 
    at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:97) 
    at org.jboss.weld.context.PassivatingContextWrapper$AbstractPassivatingContextWrapper.get(PassivatingContextWrapper.java:64) 
    at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:93) 
    at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:79) 
    at org.omnifaces.cdi.viewscope.ViewScopeManager$Proxy$_$$_WeldClientProxy.preDestroyView(Unknown Source) 
    at org.omnifaces.application.ViewScopeEventListener.processEvent(ViewScopeEventListener.java:56) 
    at javax.faces.event.SystemEvent.processListener(SystemEvent.java:108) 

이 페이지와 다른 유일한 차이점은 ViewScoped Bean을 사용한다는 것이지만 이것이 어떻게 문제가되는지 이해할 수 없습니다. 솔루션? 감사합니다

+0

이 문제를 해결할 수 있습니까? – Theo

답변

2

시도해 보셨습니까?

String path = FacesContext.getCurrentInstance().getExternalContext().getApplicationContextPath() + "/index.xhtml"; 
FacesContext.getCurrentInstance().getExternalContext().invalidateSession(); 
FacesContext.getCurrentInstance().getExternalContext().redirect(path); 

그것은 나를 위해 작동 ...

0

나는 NullPointerException이이 Wildfly9을 사용하여 슬로우와 비슷한 문제가 있었다.

사용자가 Google 시스템에 로그인하면 사용자가 로그인하고 이전 세션이 무효화됩니다.

java.lang.NullPointerException at org.jboss.weld.context.beanstore.http.AbstractSessionBeanStore.getLockStore(AbstractSessionBeanStore.java:112) [weld-core-impl-2.2.16.SP1.jar:2015-09-16 08:49] at org.jboss.weld.context.beanstore.AttributeBeanStore.lock(AttributeBeanStore.java:209) [weld-core-impl-2.2.16.SP1.jar:2015-09-16 08:49] at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:90) [weld-core-impl-2.2.16.SP1.jar:2015-09-16 08:49] at org.jboss.weld.context.PassivatingContextWrapper$AbstractPassivatingContextWrapper.get(PassivatingContextWrapper.java:76) [weld-core-impl-2.2.16.SP1.jar:2015-09-16 08:49] at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:101) [weld-core-impl-2.2.16.SP1.jar:2015-09-16 08:49] at org.jboss.weld.bean.ContextualInstanceStrategy$CachingContextualInstanceStrategy.get(ContextualInstanceStrategy.java:178) [weld-core-impl-2.2.16.SP1.jar:2015-09-16 08:49] at org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.java:50) [weld-core-impl-2.2.16.SP1.jar:2015-09-16 08:49] at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:99) [weld-core-impl-2.2.16.SP1.jar:2015-09-16 08:49] at org.jboss.weld.bean.proxy.ProxyMethodHandler.getInstance(ProxyMethodHandler.java:125) [weld-core-impl-2.2.16.SP1.jar:2015-09-16 08:49]

나는 심지어 How to hunt down obscure HA clustering bug in Wildfly 8.2.0.Final에서 제시 한 솔루션을 시도 : 문제는 우리가 다음 제이보스이 스택 트레이스를주고있다 CDI SessionScoped 빈을 사용하는 경우이다. 거기에 문제가 있지만 Stacktrace가 비슷했기 때문에 나는 그것을 시도했지만 성공하지 못했습니다.

이것은 의미가 없습니다. 왜 한 세션을 무효로하는 것이 다른 세션에 속한 세션 범위 Bean에 문제가있는 것입니까? 그것은 기본적으로 한 사용자가 로그인 할 때와 시스템에서 다른 로그를 기록 할 때와 같습니다. 그들의 세션 스코프 콩은 전혀 간섭을 가져서는 안됩니다. 마지막 희망으로 다른 스레드에서 이전 세션을 무효화하는 코드를 실행하려고 시도했지만 성공했습니다. 미지의 이유로 나에게 새로운 세션을 만들고 동일한 메소드에서 다른 사람들을 무효화하는 것은 sessionscoped 빈에 문제를 일으키는 것이지만, 다른 스레드에서 처리하는 것은 괜찮습니다.

나는 이것이 동일한 문제에 얽혀있는 다른 사람에게 도움이되기를 바랍니다.

참고 :.. 어쩌면 처음부터 접근 방식이 잘못 우리가 무효화 된 이전 세션이 다음에 사용자가 로그인해야이 하나를 시험하지 않았다가에 넣어 수 많은 작업을했다으로