Announcement Announcement Module
No announcement yet.
JSF + AspectJ - MethodNotFoundException Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • JSF + AspectJ - MethodNotFoundException

    Hello, I am trying to write an aspect for my JSF managed-beans for logging. My managed-bean is defined in my Spring Context file, not in my faces-config file.

    The logging works fine EXCEPT when an action method is called from a JSP page through value binding. When I try that, I get a MethodNotFoundException.

    For instance, my JSP has:

    <h:commandButton action=#{}/>

    When, I click this button on the JSP, the MethodNotFoundException is thrown, even though this method is clearly there. If I remove my logging aspect, the method works fine. My appcontext is as follows:

    <bean id="loggingAspect" class = "com.utils.LoggingAspect"/>
    <aop:aspect ref="loggingAspect">
    <aopointcut id="loggingCut" expression="execution(* com.managedbeans..*.*(..))"/>
    <aop:around pointcut-ref="loggingCut" method="log"/>

  • #2
    I know it's been a long time since you made this post, but I'm having the some problem. Did you manage to resolve this issue ?

    Thanks a lot.



    • #3
      Native JSF doesn't integrate well with Spring. Switch to Spring Faces on top of Spring Web Flow, as is recommended and explained in the reference guide.


      • #4
        Thanks for the response.
        Switching to Spring Faces is not an option at this time, unfortunately.
        I managed to solve the problem.
        The problem is that, when you use Spring AOP, Spring creates a proxy on top of your class that is being executed. Your class must have an interface or super class with all the public methods implemented declared in the interface/super class.
        This will cause Spring to find the methods, since it is using the interface/super class to call the methods.




        • #5
          I never found an answer to this (I've since been moved to another project), so thank you for providing this. I'll keep that in mind.

          Thanks again