Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-8297

Weld throws error No active contexts for scope type javax.enterprise.context.RequestScoped

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 6.1.0
    • None
    • Weld/CDI
    • None
    • Hide

      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.

      Show
      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.

    Description

      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

      Attachments

        Issue Links

          Activity

            People

              rmaucher Remy Maucherat
              marcos_aps Marcos Antonio (Inactive)
              Votes:
              11 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: