Announcement Announcement Module
Collapse
No announcement yet.
MethodInterceptor not being called Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • MethodInterceptor not being called

    I have a very basic HelloWorld example to which I am adding a MethodInterceptor. However it doesnt seem to be picking it up.
    Am I missing something ?


    Here is my xml configuration-

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

    <!--
    -->
    <beans>

    <bean id="helloInterceptor" class="helloWorld.LoggedGreetingService">
    </bean>

    <bean id="greetingServiceBeanNameProxyCreator"class="org .springframework.aop.framework.autoproxy.BeanNameA utoProxyCreator">
    <property name="beanNames">
    <list>
    <ref bean="greetingService"/>
    </list>
    </property>
    <property name="interceptorNames">
    <list>
    <ref bean="helloInterceptor"/>
    </list>
    </property>
    </bean>

    <bean id="greetingService" class="helloWorld.GreetingServiceImpl">
    <property name="greeting">
    <value>Hello World!</value>
    </property>
    </bean>

    </beans>

  • #2
    First of all when posting code use the [ code][/code ] tags.

    Second how are you testing it?

    Third there is an error in your configuration the beanNames property must contain the NAMES of the beans you want to proxy NOT the reference to the bean.

    Code:
    <property name="beanNames">
      <list>
        <ref bean="greetingService"/>
      </list>
    </property>
    should be

    Code:
    <property name="beanNames">
      <list>
        <value>greetingService</value>
      </list>
    </property>
    Last edited by Marten Deinum; Nov 13th, 2007, 01:32 PM.

    Comment

    Working...
    X