webtier@glassfish.java.net

Re: [webtier] ManagedProperty

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Wed, 26 Aug 2009 09:34:56 -0700

On 8/26/09 9:15 AM, webtier_at_javadesktop.org wrote:
> Hi folks,
>
> I am testing JSF 2, at the moment the DI functionality with @ManagedProperty.
> And there is my problem.
> It seems that the container does not found the referenced/wanted object.
> Code snippet:
>
> @ManagedBean(name = "fc")
> @SessionScoped
> public class FrontController {
> @ManagedProperty(value = "#{authService}")
> private AuthService authService;
>
> }
>
> @ManagedBean(eager = true, name = "authService")
> @ApplicationScoped
> public class AuthService {
>
> }
>
> The error message is:
> com.sun.faces.mgbean.ManagedBeanCreationException: Unable to create managed bean fc. The following problems were found:
> - Property authService for managed bean fc does not exist.
>
> Where is the problem?
>
> I am using:
> - jsf 2.0.0-b16
> - tomcat 6
> - jdk 6
>
> Thanks for any advice in advance!
>
Per the specification, you need to have a setter for the @ManagedProperty.

> M.Joe
> [Message sent by forum member 'mcjoe' (m_joe_c_at_hotmail.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=362013
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>
>