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

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved (View Workflow)
    • Priority: Major Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 6.1.0
    • Component/s: Weld/CDI
    • Labels:
      None
    • Environment:
      JBoss 6.0.0.M2, Windows XP SP3
    • Steps to Reproduce:
      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.
    • Similar Issues:
      Show 10 results 

      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

        Issue Links

          Activity

          Hide
          Remy Maucherat
          added a comment -

          A web build from the AS 7 branch is not going to be directly compatible.

          Show
          Remy Maucherat
          added a comment - A web build from the AS 7 branch is not going to be directly compatible.
          Hide
          Ales Justin
          added a comment -

          >> A web build from the AS 7 branch is not going to be directly compatible.
          How much effort is to port the changes / patch?

          Show
          Ales Justin
          added a comment - >> A web build from the AS 7 branch is not going to be directly compatible. How much effort is to port the changes / patch?
          Hide
          Jean-Frederic Clere
          added a comment -

          It is fixed in jbossweb for AS6 (r1789 = need a new release of jbossweb-3.0.x) for AS7 (r1590 = since first version)

          Show
          Jean-Frederic Clere
          added a comment - It is fixed in jbossweb for AS6 (r1789 = need a new release of jbossweb-3.0.x) for AS7 (r1590 = since first version)
          Hide
          Shelly McGowan
          added a comment -

          The JBoss Web update was committed:
          http://source.jboss.org/changelog/JBossAS6/?cs=111881

          Show
          Shelly McGowan
          added a comment - The JBoss Web update was committed: http://source.jboss.org/changelog/JBossAS6/?cs=111881
          Hide
          Shelly McGowan
          added a comment -

          Marcos if you have time, pls test the fix with the latest nightly build of JBoss AS 6.1.0. Considering this resolved with the recent JBoss Web update

          Show
          Shelly McGowan
          added a comment - Marcos if you have time, pls test the fix with the latest nightly build of JBoss AS 6.1.0. Considering this resolved with the recent JBoss Web update

            People

            • Assignee:
              Remy Maucherat
              Reporter:
              Marcos Antonio
            • Votes:
              11 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: