Announcement Announcement Module
Collapse
No announcement yet.
Strange BeanNameAutoProxyCreator behaviour Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Strange BeanNameAutoProxyCreator behaviour

    Hello

    I'm experiencing a weird situation with the following piece of context configuration :

    <bean id="proxyCreator" class="org.springframework.aop.framework.autoproxy .BeanNameAutoProxyCreator">
    <property name="beanNames">
    <list>
    <value>*Target</value>
    <value>*Dao</value>
    </list>
    </property>
    <property name="interceptorNames">
    <list>
    <value>interceptor</value>
    </list>
    </property>
    </bean>

    All my service beans are named like "fooTarget", and daos beans are named like "barDao".

    Now whenever I access "fooTarget", I can see my interceptor bean working fine, outputting for debug purposes every service method call and also every dao method called by the service. But If I want to directly access "barDao" from my controler, its methods are simply not available (NoSuchMethod exception).

    If I comment the *Dao value, I can directly access "barDao" again. But whenever I access "fooTarget", I don't see its inner daos methods being intercepted anymore.

    Is it a normal behaviour, because I am trying to access a dao directly instead of a service controling this dao ? I thought the autoproxying was also proxying daos not called through any service.

    Thanks

  • #2
    What you want to do should work.

    But If I want to directly access "barDao" from my controler, its methods are simply not available (NoSuchMethod exception)
    Can you post the stack trace showing what leads to this error?

    Rgds
    Rod

    Comment

    Working...
    X