Java 未显示JSF错误消息

Java 未显示JSF错误消息,java,jsf,jakarta-ee,Java,Jsf,Jakarta Ee,如果当前用户没有足够的权限,我将尝试呈现错误消息 <h:form id="distribution"> <h:panelGrid columns="1"> <h:messages errorStyle="color:red" infoStyle="color:blue" globalOnly="true" /> <rich:panel styl

如果当前用户没有足够的权限,我将尝试呈现错误消息

<h:form id="distribution">
                <h:panelGrid columns="1">
                    <h:messages errorStyle="color:red" infoStyle="color:blue" globalOnly="true" />
                    <rich:panel style="width:560px;">
                        <f:facet name="header">
                            <h:outputText value="Owners list"></h:outputText>
                        </f:facet>
                        <rich:pickList value="#{BomDistributor.selectedOwners}"
                            sourceCaption="Available Owners" targetCaption="Selected Owners"
                            listWidth="165px" listHeight="100px" orderable="true"
                            required="true" requiredMessage="Please select owner">
                            <f:selectItems value="#{BomDistributor.availableOwners}"
                                var="capital" />

                        </rich:pickList>

                    </rich:panel>
                </h:panelGrid>

            </h:form>
} 但我是在控制台上看到的

INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
sourceId=null[severity=(ERROR 2), summary=(Not Allowed), detail=(Only Admins can upload jobs)]

我做错了什么?

在哪里实例化bean,在哪里使用它,它有什么作用域?当我单击一个链接和它的ViewScope作用域时,bean被初始化
INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
sourceId=null[severity=(ERROR 2), summary=(Not Allowed), detail=(Only Admins can upload jobs)]