JSF 2.1.7/2.1.17 on Glassfish managed beans not resolved

From: Dave <>
Date: Thu, 7 Mar 2013 16:20:54 -0800 (PST)


My JSF application works on JBoss 7.1.1.
I tried on Glassfish, all managed beans are not recognized.
The same version of Mojarra 2.1.7 is used in both cases.
 /view.xhtml @13,75 listener="#{viewBean.preRenderView}": Target
Unreachable, identifier 'viewBean' resolved to null
       at com.sun.faces.facelets.el.TagMethodExpression.invoke(
       at com.sun.faces.facelets.tag.jsf.core.DeclarativeSystemEventListener.processEvent(
       at javax.faces.component.UIComponent$ComponentSystemEventListenerAdapter.processEvent(
       at javax.faces.event.SystemEvent.processListener(
       at com.sun.faces.application.ApplicationImpl.processListeners(
       at com.sun.faces.application.ApplicationImpl.invokeComponentListenersFor(
       at com.sun.faces.application.ApplicationImpl.publishEvent(
       at com.sun.faces.application.ApplicationImpl.publishEvent(
       at com.sun.faces.lifecycle.RenderResponsePhase.execute(
       at com.sun.faces.lifecycle.Phase.doPhase(
       at com.sun.faces.lifecycle.LifecycleImpl.render(
       at javax.faces.webapp.FacesServlet.service(

Facelet page:
<f:view locale="#{viewBean.locale}"> 
<f:event type="preRenderView" listener="#{viewBean.preRenderView}" />

From debugging, all managed beans with @ManagedBean annotation are not built. So all managed beans are resolved to null.

public class ViewBean  {
It works on JBoss 7.

Anyone uses Grassfish 3 with Mojarra 2.1.7? I replaced the jsf impl with javax.faces.2.1.17, no luck, same error.
 Also posted in
Thanks for any help.  
-------------------By the way, I forgot the password on Trying to reset password many times, but never got email for resetting password. I use yahoo email. Anyone knows why? Thanks.