It seems that Glassfishv3 does not currently work with form based authentication?
When it is lazy authentication by stipulating a security-constraint on a url-pattern in web.xml which should redirect to the form-login-page, I get the error.
Or whether I access the form-login-page directly and submit an incorrect username/password combination, I also get the error (a valid user in this case will log in correctly).
Is there something other than the above to get this to work? It seems it is a Weld issue?
I have an empty beans.xml file in the WEB-INF directory of my WAR.
An example exception I get from the latest Glassfishv3.1 nightly is:
javax.enterprise.context.ContextNotActiveException: No active contexts for scope type javax.enterprise.context.RequestScoped
at org.jboss.weld.BeanManagerImpl.getContext(BeanManagerImpl.java:928)
at org.jboss.weld.bean.proxy.ClientProxyMethodHandler.getProxiedInstance(ClientProxyMethodHandler.java:140)
at org.jboss.weld.bean.proxy.ClientProxyMethodHandler.invoke(ClientProxyMethodHandler.java:101)
at org.jboss.weld.servlet.HttpSessionManager_$$_javassist_14.setSession(HttpSessionManager_$$_javassist_14.java)
at org.jboss.weld.jsf.WeldPhaseListener.initiateSessionAndConversation(WeldPhaseListener.java:169)
at org.jboss.weld.jsf.WeldPhaseListener.beforeRestoreView(WeldPhaseListener.java:118)
at org.jboss.weld.jsf.WeldPhaseListener.beforePhase(WeldPhaseListener.java:87)
at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:110)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1518)
at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:784)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:479)
at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:450)
at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:346)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:296)
at org.apache.catalina.authenticator.FormAuthenticator.forwardToLoginPage(FormAuthenticator.java:458)
at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:249)
at com.sun.web.security.RealmAdapter.invokeAuthenticateDelegate(RealmAdapter.java:1184)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:604)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
[Message sent by forum member 'cosmic' (cory_at_prowse.com)]
http://forums.java.net/jive/thread.jspa?messageID=384155