Announcement Announcement Module
Collapse
No announcement yet.
How to use Spring AOP and AspectJ for both proxy and interface based aspects Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to use Spring AOP and AspectJ for both proxy and interface based aspects

    Im trying to add @AspectJ annotation-style aspects around both concrete classes (ex. spring mvc controller) as well as interface methods (ex. spring data jpa). The Spring 3.x documentation is clear on how to configure aspects for one or the other but not both. Using cglib works for controller methods (concrete classes) but not for interfaces.
    Is it possible to do both in one configuration?

  • #2
    I think that, by default, JDK proxies are created if the class implements at least one interface. If it doesn't, CGLIB library is used. If it can't find the library throws an exception, if it does it's using it. What I'm suggesting is to leave the settings as is, without any proxy-target-class value.

    Also, please note that we are currently in the process of moving to stackoverflow.com for our forums. If you're still having this issue please consider asking it again at http://stackoverflow.com using the #spring tag and someone should be able to help you. Thanks!

    Comment

    Working...
    X