users@javaserverfaces.java.net

Re: JSF on Glassfish 3.1.2.2: managed beans not resolved

From: Hildeberto Mendonça <me_at_hildeberto.com>
Date: Mon, 11 Mar 2013 11:14:45 +0100

What happens if you simply remove the annotation
@ManagedBean(name="viewBean")? I believe it will work in both because the
name of the bean class with its first letter in lower case, as you defined,
is actually the default one.

On Fri, Mar 8, 2013 at 5:27 AM, Dave <javaone9_at_yahoo.com> wrote:

> Hi,
>
> My JSF application works on JBoss 7.1.1.
> I tried on Glassfish 3.1.2.2(newest), all managed beans are not recognized.
> The same version of Mojarra 2.1.7 is used in both cases.
>
> [#|2013-03-07T17:33:36.734-0500|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=18;_ThreadName=Thread-2;|javax.el.PropertyNotFoundException:
> /view.xhtml @13,75 listener="#{viewBean.preRenderView}": Target
> Unreachable, identifier 'viewBean' resolved to null
> at
> com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:107)
> at
> com.sun.faces.facelets.tag.jsf.core.DeclarativeSystemEventListener.processEvent(EventHandler.java:128)
> at
> javax.faces.component.UIComponent$ComponentSystemEventListenerAdapter.processEvent(UIComponent.java:2486)
> at
> javax.faces.event.SystemEvent.processListener(SystemEvent.java:106)
> at
> com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2168)
> at
> com.sun.faces.application.ApplicationImpl.invokeComponentListenersFor(ApplicationImpl.java:2116)
> at
> com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:288)
> at
> com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:246)
> at
> com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:108)
> at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
> at
> com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
> at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
>
> Facelet page:
>
> <f:view locale="#{viewBean.locale}">
> <f:event type="preRenderView" listener="#{viewBean.preRenderView}" />
> ....
> </f:view>
>
>
> From debugging, all managed beans with @ManagedBean annotation are not
> built. So all managed beans are resolved to null.
>
> @ManagedBean(name="viewBean")
> @ViewScoped
> 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.
>
> Thanks for any help.
> Dave




-- 
Hildeberto Mendonça, Ph.D
Blog: http://www.hildeberto.com
Twitter: https://twitter.com/htmfilho <http://www.cejug.org>