users@glassfish.java.net

ServerAuthModule cannot forward to JSF page - No active contexts for scope

From: <glassfish_at_javadesktop.org>
Date: Tue, 13 Jul 2010 03:37:24 PDT

When implementing my own ServerAuthModule in Glassfish 3.0.1 I cannot redirect to a JSF page.

I am essentially doing the following:
                final RequestDispatcher disp = request.getRequestDispatcher("/login.xhtml");
                disp.forward(request, response);

Is there a way to ensure that the RequestScope is active in WELD?

Full stack trace is:

[#|2010-07-13T20:08:07.502+1000|WARNING|glassfish3.0.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=27;_ThreadName=http-thread-pool-18081-(2);|ApplicationDispatcher[/projectx] PWC1231: Servlet.service() for servlet Faces Servlet threw exception
org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type javax.enterprise.context.RequestScoped
        at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:679)
        at org.jboss.weld.bean.proxy.ClientProxyMethodHandler.getProxiedInstance(ClientProxyMethodHandler.java:138)
        at org.jboss.weld.bean.proxy.ClientProxyMethodHandler.invoke(ClientProxyMethodHandler.java:100)
        at org.jboss.weld.util.CleanableMethodHandler.invoke(CleanableMethodHandler.java:43)
        at org.jboss.weld.servlet.HttpSessionManager_$$_javassist_19.setSession(HttpSessionManager_$$_javassist_19.java)
        at org.jboss.weld.jsf.WeldPhaseListener.initiateSessionAndConversation(WeldPhaseListener.java:168)
        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:1523)
        at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:822)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:517)
        at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:488)
        at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:379)
        at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:336)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:314)
        at au.projectx.openid.sam.OpenIdSam.forwardToPage(OpenIdSam.java:136)
        at au.projectx.openid.sam.OpenIdSam.validateRequest(OpenIdSam.java:123)
        at com.sun.enterprise.security.jmac.config.GFServerConfigProvider$GFServerAuthContext.validateRequest(GFServerConfigProvider.java:1167)
        at com.sun.web.security.RealmAdapter.validate(RealmAdapter.java:1303)
        at com.sun.web.security.RealmAdapter.invokeAuthenticateDelegate(RealmAdapter.java:1184)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:619)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:615)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
        at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:239)
        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
        at java.lang.Thread.run(Thread.java:637)
|#]
[Message sent by forum member 'cosmic']

http://forums.java.net/jive/thread.jspa?messageID=477492