In my application I have a top bar with a logout button that call the bean method
public String logout(){
FacesContext.getCurrentInstance().getExternalContext().invalidateSession();
return Navigator.goTo("/index.xhtml");
}
it works well, but I have a specific page where it fails with this exception
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)
The only difference between this page and the other is that this one use a ViewScoped Bean, but I don't understand how this could be a problem. solutions? thanks