Search code examples
javajbossseam

org.jboss.seam.RequiredException: @In attribute requires non-null value: selectAccountPageBean.accountSessionBean


The "Caused by:" section of my stack trace says:

Caused by: org.jboss.seam.RequiredException: 
@In attribute requires non-null value: selectAccountPageBean.accountSessionBean

The Page-scoped bean has this:

@Name("selectAccountPageBean")
@Scope(ScopeType.PAGE)
public class SelectAccountPageWidgetBean 
    extends BaseWidgetBean implements Serializable
{
...
    @In(create = true)
    private AccountSessionBean accountSessionBean;
...
}

The Session-scoped bean has this:

@Name("accountSessionBean")
@Scope(ScopeType.SESSION)
public class AccountSessionBean implements Serializable
{
...
}

When I refer to the Page-scoped bean from a facelet, I get the error.

I've done this same thing in other apps and it worked fine. Is there some configuration value that I'm missing somewhere?


Solution

  • I'm not sure which change fixed it, but we did two things.

    1. We added in a components.properties file. Someone suggested that we should have one on
      the classpath even if it's empty.
    2. We had a problem with the package that the component was in. The package structure was something like:

      foo.bar.baz
      

      But the component was in a directory like:

      foo/bar/pirate/monkey/baz
      

    We simply moved the file to the proper directory.