title: WELD-001303: No active contexts for scope type javax.faces.flow.FlowScoped
body: <p>Just started doing my first steps with FacesFlow with Glassfish 4.1 (i.e. using Mojarra) and when invoking my flow I get an error named </p>
  
  <pre><code>[SEVERE] [] [javax.enterprise.resource.webcontainer.jsf.application] ...  Error Rendering View[/register/register.xhtml]
  org.jboss.weld.context.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.faces.flow.FlowScoped
      at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:708)
  </code></pre>
  
  <p>Several others had that error too as I can see in the web but the solutions that worked for other somehow dont work for me (see below).</p>
  
  <p>I also tried <code>@SessionScoped</code> which works. So it is related to <code>@FlowScoped</code>.</p>
  
  <p>To what I read in a book that I use to get me up to speed I should be ok from coding and config end since according to API <code>@FlowScoped</code> is CDI based and I use the following code at my backing bean/controller.</p>
  
  <pre><code>@Named
  @FlowScoped(value="register")
  public class RegisterController implements Serializable {
  </code></pre>
  
  <p>I have a flow named register whose pages are located in a dirctory /register and the first page of the flow is named register.xhtml</p>
  
  <p>Following snippet I tried both as a <code>register/register-flow.xml</code> config file as well as <code>WEB-INF/faces-config.xml</code> without success.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;faces-config
      xmlns="http://xmlns.jcp.org/xml/ns/javaee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
      version="2.2"&gt;
      &lt;flow-definition id="register"&gt;
          &lt;flow-return id="overview"&gt;
              &lt;from-outcome&gt;/index&lt;/from-outcome&gt;
          &lt;/flow-return&gt;
      &lt;/flow-definition&gt;
  &lt;/faces-config&gt;
  </code></pre>
  
  <p>What I tried so far:
  I found a post suggesting that <code>&lt;Context antiJARLocking="true" path="/PROJEST_NAME"/&gt;</code> would solve the problem but after googling the tag it turns out its an outdated Tomcat tag. </p>
  
  <p>Changing <code>@Named</code> to <code>@ManagedBean</code> didn't really help as suggested on one page. I could open the pages but the data in my controller class would not be available when invoking the next page of the flow anymore. But <code>@ManagedBean</code> shouldn't really work I guess since <code>@FlowScoped</code> is CDI based.</p>
  
  <p>Another post suggested to ensure that <code>javax.faces.CLIENT_WINDOW_MODE</code> is enabled. I tried that via adding the following to my web.xml but without success </p>
  
  <pre><code>&lt;context-param&gt;
  &lt;param-name&gt;javax.faces.CLIENT_WINDOW_MODE&lt;/param-name&gt;
  &lt;param-value&gt;url&lt;/param-value&gt;
  &lt;/context-param&gt;
  </code></pre>
  
  <p>Another suggested to use Glassfish 4.x which I already do</p>
  
  <p>Any ideas?</p>