behavior tracking JSF managed beans

Help
Pragnesh
2009-06-05
2013-05-09
  • Pragnesh

    Pragnesh - 2009-06-05

    I am tring to pointcut the JSF managed bean. I am using jsf.DelegatingVariableResolver in faces-config.xml. This way I can now use Spring beans. However, now when I try to pointcut as follows:

        <bt:manager application="beet-hello"
            flush-schedule="0/30 * * * * ?"
            track-method-expression="execution(* oracle.samples.wlp.jsf..*(..))">
            <bt:xml-persister binary="false" compress="false" file="/beet-login-perf.xml"/>       
            <bt:http-requests parameters="_pageLabel"/>
        </bt:manager>

    Now I am getting following exception.

    javax.faces.el.PropertyNotFoundException: Error getting property 'authenticated' from bean of type $Proxy65
            at com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:107)
            at com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:167)
            at com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:151)
            at com.sun.faces.el.impl.UnaryOperatorExpression.evaluate(UnaryOperatorExpression.java:167)
            at com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:243)
            at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:173)
            at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:154)
            at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:315)
            at javax.faces.webapp.UIComponentTag.shouldBeSuppressed(UIComponentTag.java:1281)
            at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:475)
            at com.sun.faces.taglib.html_basic.FormTag.doStartTag(FormTag.java:345)
            at jsp_servlet._loginportlet.__loginportlet._jsp__tag3(__loginportlet.java:269)
            at jsp_servlet._loginportlet.__loginportlet._jsp__tag2(__loginportlet.java:226)
            at jsp_servlet._loginportlet.__loginportlet._jsp__tag1(__loginportlet.java:175)
            at jsp_servlet._loginportlet.__loginportlet._jspService(__loginportlet.java:101)
            at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)

    Any idea of how to solve this issue and start tracking my JSF managed beans?

     
    • Andreanes Yosef Vanderlee

      Hi Pragnesh,

      This problem actually regarding the Spring AOP proxying. It'll be okay if our JSF managed bean implements some interface that will be a proxy for AOP.

      --
      Andre

       
    • Jason Trump

      Jason Trump - 2009-06-24

      To add a little detail to what Andre has said,  the problem is that your bean is being replaced with a JDK interface proxy at runtime. 

      Your bean implements an interface that doesn't have an 'isAuthenticated' method, but your actual bean class does.  You have two choices:

      1.  add the accessor method for 'authenticated' to the interface (if possible / appropriate)
      2.  switch to using class-based proxies.  for example, add

      <aop:config proxy-target-class="true"/>

      to your spring config.  See http://static.springframework.org/spring/docs/2.5.6/reference/aop.html#aop-proxying for an explanation.

      -jt

       

Log in to post a comment.