I don't know why it would matter, but then again I probably haven't
tried such a thing with managed beans myself.

Any chance you could send just the method signatures for the
getters/setters and the definition of this property (no logic needed,
just the signatures) for the interface, abstract class and impl class
itself?    Send it to me directly if you want to avoid extra clutter on
the list - I'm curious enough now to spend a few mins looking at it just
to understand the issue myself :-)... 



-----Original Message-----
From: David Tashima [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 02, 2005 2:21 PM
To: Mike Burati
Cc: MyFaces Discussion
Subject: Re: PropertyNotFoundException when managed bean implements an
interface?

Yes, so ArticleUIBean has the getter and setter.

The magical part happens when I remove "implements IArticleUIBean"
from AbstractArticleUIBean (a super class of ArticleUIBean) - then
everything works.

(IArticleUIBean also has the getters/setters defined as well... but it
shouldn't matter, should it?).

-Dave

On 6/2/05, Mike Burati <[EMAIL PROTECTED]> wrote:
> 
> From the looks of the code in the PropertyResolverImpl where you're 
> getting that exception, it's Java reflection that's saying that 
> there's no such setter (write method) for that property:
> 
>         PropertyDescriptor propertyDescriptor = 
> getPropertyDescriptor(base, name);
>         Method m = propertyDescriptor.getWriteMethod();
>         if (m == null)
>         {
>             throw new PropertyNotFoundException(
>                 "Bean: " + base.getClass().getName() + ", property: " 
> + name);
>         }
> 
> Might be worth trying similar code standalone on your bean.
> Note, base is the instance of the bean class (ArticleUIBean in your
> case) and name is the name of the property.
> 
> So ArticleUIBean contains a public method setSecretsBean ?
> 
> From the location of the exception, it looks like reflection is 
> finding the property, but not a public writer method for it.
> If it wasn't finding the property at all, I would expect the exception

> to come from getPropertyDescriptor instead of from setProperty.
> 
> 
> 
> 
> -----Original Message-----
> From: David Tashima [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 02, 2005 1:57 PM
> To: [EMAIL PROTECTED]
> Cc: MyFaces Discussion
> Subject: Re: PropertyNotFoundException when managed bean implements an

> interface?
> 
> Here is the trace:
> 109687 [http-8080-Processor24] ERROR
> org.apache.myfaces.el.PropertyResolverImpl  - 
> com.winerhino.ui.ArticleUIBean
> javax.faces.el.PropertyNotFoundException: Bean:
> com.winerhino.ui.ArticleUIBean, property: secretsBean
> 
>         at
> org.apache.myfaces.el.PropertyResolverImpl.setProperty(PropertyResolve
> rI
> mpl.java:372)
>         at
> org.apache.myfaces.el.PropertyResolverImpl.setValue(PropertyResolverIm
> pl
> .java:180)
>         at
> org.apache.myfaces.config.ManagedBeanBuilder.initializeProperties(Mana
> ge
> dBeanBuilder.java:151)
>         at
> org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(ManagedB
> ea
> nBuilder.java:63)
>         at
> org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableRes
> ol
> verImpl.java:328)
>         at
> org.apache.myfaces.el.ValueBindingImpl$ELVariableResolver.resolveVaria
> bl
> e(ValueBindingImpl.java:637)
>         at
> org.apache.commons.el.NamedValue.evaluate(NamedValue.java:124)
>         at
> org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndProperty(ValueB
> in
> dingImpl.java:518)
> 
>         at
> org.apache.myfaces.el.MethodBindingImpl.resolveToBaseAndProperty(Metho
> dB
> indingImpl.java:195)
>         at
> org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:
> 12
> 3)
>         at
> org.apache.myfaces.application.ActionListenerImpl.processAction(Action
> Li
> stenerImpl.java:62)
>         at
javax.faces.component.UICommand.broadcast(UICommand.java:106)
>         at
>
javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:110)
>         at
>
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:184)
>         at
> org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(Lifecycle
> Im
> pl.java:271)
>         at
> org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:
> 10
> 2)
>         at
> javax.faces.webapp.FacesServlet.service(FacesServlet.java:109)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli
> ca
> tionFilterChain.java:252)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi
> lt
> erChain.java:173)
>         at
> org.apache.myfaces.component.html.util.MultipartFilter.doFilter(Multip
> ar
> tFilter.java:105)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli
> ca
> tionFilterChain.java:202)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi
> lt
> erChain.java:173)
>         at
>
com.winerhino.servlet.HibernateFilter.doFilter(HibernateFilter.java:41)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli
> ca
> tionFilterChain.java:202)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi
> lt
> erChain.java:173)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVa
> lv
> e.java:213)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextVa
> lv
> e.java:178)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.ja
> va
> :126)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.ja
> va
> :105)
>         at
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
> java:107)
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
> :1
> 48)
>         at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
> 85
> 6)
>         at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proces
> sC
> onnection(Http11Protocol.java:744)
>         at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoi
> nt
> .java:527)
>         at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFoll
> ow
> erWorkerThread.java:80)
>         at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPo
> ol
> .java:684)
>         at java.lang.Thread.run(Unknown Source)
> 
> 
> 
> 
> 
> On 6/2/05, Martin Marinschek <[EMAIL PROTECTED]> wrote:
> > can you post the stacktrace?
> >
> > regards,
> >
> > Martin
> >
> > On 6/2/05, David Tashima <[EMAIL PROTECTED]> wrote:
> > > Hey everyone,
> > >
> > > I get a very weird PropertyNotFoundException when trying to 
> > > initialize a managed bean whose class implements an interface. It 
> > > can't find the setter for a property, even though the setter 
> > > exists on both the class and the interface.
> > >
> > > When I strip the "implements IInterface", it works great.
> > >
> > > This doesn't make any sense to me, as I didn't change any of the 
> > > face-config.xml (it still points to the original class).
> > >
> > > Has anyone seen this? I'm on 1.0.9.
> > >
> > > -Dave
> > >
> >
>

Reply via email to