WARN:Cannot create Seam component, scope is not active: seamUserRoleList(CONVERSATION)
northbright Nov 21, 2010 6:29 AMHi!
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!
Warnings:
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:
@Name("seamUserRoleList") @Scope(ScopeType.PAGE) public class SeamUserRoleList extends EntityQuery<SeamUserRole> { /** * */ private static final long serialVersionUID = 1L; public SeamUserRoleList() { setEjbql("select seamUserRole from SeamUserRole seamUserRole"); } }
@Name("seamUserHome") @Scope(ScopeType.PAGE) public class SeamUserHome extends EntityHome<SeamUser> { /** * */ private static final long serialVersionUID = 1L; @RequestParameter Integer seamUserId; @Override public Object getId() { if (seamUserId == null) { return super.getId(); } else { return seamUserId; } } @Override @Begin public void create() { super.create(); } }
My xhtml files:
SeamUserList.xhtml:
<rich:panel> <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" value="#{seamUserList.resultList}" rendered="#{not empty seamUserList.resultList}"> <h:column> <f:facet name="header">Id</f:facet> <h:outputText id="seamUserid" value="#{seamUser.userId}"> </h:outputText> </h:column> <h:column> <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:param> </s:link> </h:column> <h:column> <f:facet name="header">Roles</f:facet> <rich:dataList var="role" value="#{seamUser.roles}"> <h:outputText value="#{role.toString()}"> </h:outputText> </rich:dataList> </h:column> </h:dataTable></div> </rich:panel>
End SeamUser.xhtml:
<h:form id="seamUserForm"> <rich:panel> <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> <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}" /> </s:decorate> <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" targetValue="#{seamUserHome.instance.roles.toArray()}" sourceCaptionLabel="Available Roles" targetCaptionLabel="Current Roles of User" converter="org.jboss.seam.ui.EntityConverter"> <rich:column> <h:outputText value="#{role.rolename}"></h:outputText> </rich:column> </rich:listShuttle> <h:commandButton action="#{seamUserHome.update}" value="Save Roles"> </h:commandButton> </rich:panel> <div class="actionButtons"><h:commandButton id="save" value="Save" action="#{seamUserHome.persist}" rendered="#{!seamUserHome.managed}"> </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" rendered="#{seamUserHome.managed}"> </h:commandButton> <s:button propagation="end" id="cancel" value="Cancel" view="/seamUserList.xhtml"> </s:button></div> </rich:panel> </h:form>