1

I implement a faces flow for a registration process, but I get this error when I annotate the bean "CreateBn" with @FlowScoped, and when I use CDI: SessionScoped it works:

2014-09-01T10:47:58.010+0000|Avertissement: JSF1063 : AVERTISSEMENT ! D�finition d�une valeur 
d�attribut non-s�rialisable dans HttpSession (cl� : 0d4116bdc7f306730f3ea26b84ab:0_flowStack, classe de la valeur : com.sun.faces.flow.FlowHandlerImpl$FlowDeque).
2014-09-01T10:47:58.013+0000|Grave: Error Rendering View[/inscription/inscription.xhtml]
javax.el.ELException: /inscription/inscription.xhtml @12,60 value="#{createBn.user.email}": org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type javax.faces.flow.FlowScoped
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:114)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)

and here is the bean:

@Named
@FlowScoped("inscription")
public class CreateBn implements Serializable{

private static final long serialVersionUID = 1L;

private static final String INSCRIPTION_RETURN = "inscription_return";  

private User user;
...

and I'm sure that there is no file naming error: flow folder, xxx-flow.xml, xxx-return.xhtml. Help please

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
user3923327
  • 137
  • 1
  • 4
  • 11

2 Answers2

0

I'm not sure but it might be fixed by editing your xml config file and place there a code like:

<faces-config version="2.2" 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">

    <flow-definition id="inscription">
    </flow-definition>
</faces-config>

if that not helps, check if you are not context.xml in your WEB-INF folder with content

<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/PROJEST_NAME"/>

I had similar problem but doing one of them or both (i dont rememeber) i had problem solved.

If that was any help (or not), please give a note with was it. I'm trying to learn flows myself and found few obstacles (this was one of them).

T.G
  • 1,913
  • 1
  • 16
  • 29
0

Was getting this when i had a graphicImage viewer or documentViewer that binds to a value in a view scoped bean. So I moved the value/contact of what needs to be on the graphicImage viewer and documentViewer to a new managed bean which is session scoped and set cached to false on the graphicviewer. I know it's just a work around but it works pretty well.