[jboss-jira] [JBoss JIRA] Updated: (JBAS-8873) Unexpected error forwarding to login page - No active contexts for scope type javax.enterprise.context.RequestScoped

q q (JIRA) jira-events at lists.jboss.org
Mon Feb 14 16:17:13 EST 2011


     [ https://issues.jboss.org/browse/JBAS-8873?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

q q updated JBAS-8873:
----------------------

           Description:     (was: 2010-04-22 09:55:36,484 WARN  [org.apache.catalina.authenticator.FormAuthenticator] (http-127.0.0.1-8080-1) Unexpected error forwarding to login page: javax.servlet.ServletException: WELD-001303 No active contexts for scope type javax.enterprise.context.RequestScoped)
    Steps to Reproduce: Configure FORM authentication and go to the restricted resource.  (was: Unfortunately I could not make my project simpler for your convenience in testing it.
If I made it simpler the error would not appear, because I getting it with this
configuration. I'm not saying either that the project is a complicated one. Indeed it
is a simple project that I'm using to start with Java EE 6, with few files and classes.
Below are the steps to set up the project and to get the error:

1. Create the directory C:\Projeto\Java\Solicitacoes3. Drop the contents of the zip file in this
   directory. I'm using the ant build.xml file in the solicitacoes-web project directory
   to build the application. If you want to create other directory other than
   C:\Projeto\Java\Solicitacoes3 you'll need to modify the build file. Looking at the
   contents of the build file you'll see that I'm creating an EAR project composed of
   an EJB, EJB client and WEB project. The file is very simple.

2. Add this entry to the file {JBOSS-HOME}\server\default\conf\login-config.xml:

<application-policy name="solicitacoes">
    <authentication>
        <login-module code="br.urca.solicitacoes.ejb.seguranca.ModuloLogin" flag="required" />
    </authentication>
</application-policy>

3. Copy the file solicitacoes-ear-ds.xml to {JBOSS-HOME}\server\default\deploy. This is
   the data source configuration that I'm using. It uses MS SQL Server, but of course
   I don't expect that you have this database to test. You can substitute the contents
   of this file to work with the datasource you want. It just has to has the name
   solicitacoes-ear-ds.xml. I'm using only five database entities in my project. I don't
   know if you need to create these entities in your database because the error happens
   before I have the change to manipulate any entity in the application. Also, I think
   that when JBoss is starting up it doesn't try to see that the tables that are mapped
   to the entities really exist in the database. So, I think that it won't be necessary
   to create the tables in the database you choose. In case the tables are required to
   be created, there is also a file script.sql in the zip file with the table structures.

4. After you deploy the EAR file, type the url in the browser
   http://localhost:8080/solicitacoes. You'll see the error. If you comment all the security
   section in the web.xml file not to call the login.xhtml page, the error will go away and
   the page novasolicitacao.xhtml will show successfully. But when the FORM based authentication
   is enabled the error appears.)


Servlet.service() for servlet Faces Servlet threw exception: java.lang.IllegalStateException: Could not wrap ExternalContext
	at org.jboss.seam.faces.environment.SeamExternalContextFactory.getExternalContext(SeamExternalContextFactory.java:35) [:3.0.0-SNAPSHOT]
	at com.sun.faces.context.FacesContextFactoryImpl.getFacesContext(FacesContextFactoryImpl.java:89) [:2.0.3-]
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:298) [:2.0.3-]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:734) [:6.0.0.Final]
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:541) [:6.0.0.Final]
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:479) [:6.0.0.Final]
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:407) [:6.0.0.Final]
	at org.apache.catalina.authenticator.FormAuthenticator.forwardToLoginPage(FormAuthenticator.java:317) [:6.0.0.Final]
	at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:242) [:6.0.0.Final]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:559) [:6.0.0.Final]
	at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
	at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.Final]
	at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.Final]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.Final]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.Final]
	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.Final]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.Final]
	at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.Final]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.Final]
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.0.0.Final]
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [:6.0.0.Final]
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.0.0.Final]
	at java.lang.Thread.run(Unknown Source) [:1.6.0_23]
Caused by: 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:643) [:6.0.0.Final]
	at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:77) [:6.0.0.Final]
	at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:87) [:6.0.0.Final]
	at org.jboss.seam.faces.environment.org$jboss$weld$bean-jboss$classloader:id="vfs:$$$D:$Studia$PM$$metadata$$plugins$org$jboss$ide$eclipse$as$core$JBoss_6$0_Runtime_Server1297123148204$deploy$Reservations$ear"-ManagedBean-class_org$jboss$seam$faces$environment$SeamExternalContext_$$_WeldClientProxy.setWrapped(org$jboss$weld$bean-jboss$classloader:id="vfs:$$$D:$Studia$PM$$metadata$$plugins$org$jboss$ide$eclipse$as$core$JBoss_6$0_Runtime_Server1297123148204$deploy$Reservations$ear"-ManagedBean-class_org$jboss$seam$faces$environment$SeamExternalContext_$$_WeldClientProxy.java)
	at org.jboss.seam.faces.environment.SeamExternalContextFactory.getExternalContext(SeamExternalContextFactory.java:29) [:3.0.0-SNAPSHOT]
	... 25 more

> Unexpected error forwarding to login page - No active contexts for scope type javax.enterprise.context.RequestScoped
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: JBAS-8873
>                 URL: https://issues.jboss.org/browse/JBAS-8873
>             Project: JBoss Application Server
>          Issue Type: Bug
>          Components: Weld/CDI
>         Environment: JBoss 6.0.0.Final, Windows 7
>            Reporter: q q
>            Priority: Critical
>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list