2 Replies Latest reply on Nov 24, 2010 7:26 PM by Norbert Korodi

    WARN:Cannot create Seam component, scope is not active: seamUserRoleList(CONVERSATION)

    Norbert Korodi Newbie


      Why do i always get this warn?
      I'm trying to save a PAGE scoped Entity (id obtained from other xhtml in param).
      It doesn't make any sense. Thank you!


      WARN  [org.jboss.seam.Component] Cannot create Seam component, scope is not active: seamUserRoleList(CONVERSATION)
      12:17:53,859 WARN  [org.jboss.seam.Component] Cannot create Seam component, scope is not active: seamUserHome(CONVERSATION)

      My entities:

      public class SeamUserRoleList extends EntityQuery<SeamUserRole>
              private static final long serialVersionUID = 1L;
              public SeamUserRoleList()
              setEjbql("select seamUserRole from SeamUserRole seamUserRole");

      public class SeamUserHome extends EntityHome<SeamUser>
              private static final long serialVersionUID = 1L;
          Integer seamUserId;
          public Object getId()
              if (seamUserId == null)
                  return super.getId();
                       return seamUserId;
          @Override @Begin
          public void create() {

      My xhtml files:

                              <f:facet name="header">seamUserList</f:facet>
                              <div class="results"><h:outputText value="No seamUser exists"
                                      rendered="#{empty seamUserList.resultList}">
                              </h:outputText> <h:dataTable id="seamUserList" var="seamUser"
                                      rendered="#{not empty seamUserList.resultList}">
                                              <f:facet name="header">Id</f:facet>
                                              <h:outputText id="seamUserid" value="#{seamUser.userId}">
                                              <f:facet name="header">UserName</f:facet>
                                              <s:link id="seamUser" value="#{seamUser.username}"
                                                      propagation="none" view="/seamUser.xhtml">
                                                      <f:param name="seamUserId" value="#{seamUser.userId}">
                                              <f:facet name="header">Roles</f:facet>
                                              <rich:dataList var="role" value="#{seamUser.roles}">
                                                      <h:outputText value="#{role.toString()}">

      End SeamUser.xhtml:

      <h:form id="seamUserForm">
                                      <f:facet name="header">seamUser</f:facet>
                                      <s:decorate id="nameField" template="layout/edit.xhtml">
                                              <ui:define name="label">Name</ui:define>
                                              <h:inputText id="username" required="true"
                                                      value="#{seamUserHome.instance.username}" />
                                      <s:decorate id="passwordField" template="layout/edit.xhtml">
                                              <ui:define name="label">Password</ui:define>
                                              <h:inputText id="password" required="true"
                                                      value="#{seamUserHome.instance.password}" />
                                      <div style="clear: both" />
                                      <rich:panel rendered="#{seamUserHome.managed}">
                                              <f:facet name="header">Set UserRoles</f:facet>
                                              <rich:listShuttle id="shuttle"
                                                      sourceValue="#{seamUserRoleList.resultList}" sourceRequired="true"
                                                      targetRequired="false" var="role"
                                                      sourceCaptionLabel="Available Roles"
                                                      targetCaptionLabel="Current Roles of User"
                                                              <h:outputText value="#{role.rolename}"></h:outputText>
                                              <h:commandButton action="#{seamUserHome.update}"
                                                      value="Save Roles">
                                      <div class="actionButtons"><h:commandButton id="save"
                                              value="Save" action="#{seamUserHome.persist}"
                                      </h:commandButton> <h:commandButton id="update" value="Update"
                                              action="#{seamUserHome.update}" rendered="#{seamUserHome.managed}">
                                      </h:commandButton> <h:commandButton id="delete" value="Delete"
                                              action="#{seamUserHome.remove}" immediate="true"
                                      </h:commandButton> <s:button propagation="end" id="cancel" value="Cancel"

        • 1. Re: WARN:Cannot create Seam component, scope is not active: seamUserRoleList(CONVERSATION)
          Paul Dijou Newbie

          Same problem for me (Topic), not found any solution yet.

          After a few investigations, it appears that when you submit you form from you SeamUserList, the h:dataTable will invoke the method in its value parameter (in your case #{seamUserList.resultList}) but during this invoke, the ConversationContext is not active (neither the PageContext fyi) and so the warning appears.

          In the h:dataTable, it's just a warning, but try using a rich:dataTable and, if your case is like mine, you will have the warning and your application crashing.

          I don't have any idea of the problem's reason, don't know how to correct it, thinking it's come from Seam Scope that I don't manage well... if someone has a solution, thanks to him.

          • 2. Re: WARN:Cannot create Seam component, scope is not active: seamUserRoleList(CONVERSATION)
            Norbert Korodi Newbie


            Thnx for the reply.

            I think my conversation end page context do exist when I invoke the


            but they somehow disappear, when I try to persist any object. I debugged it with a seam Conversational JavaBean (created it just for testing, put all the Page scoped Beans in it), so there was a conversational scope, but the persist() function did something...
            I have no idea where to look for any solution... at contexts reference guide, or at the view (jsf) guide? Any suggestion would be very appriciated!

            And again, thnx for Your reply Paul!