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

  • Advice not executing

    I have added an AfterReturning advise to my application but it is not getting executed. I don't get any errors; nothing happens when I execute the target methods...
    here is the config:
    Code:
    	<bean id="complaintService" 				class="za.co.fnb.bis.complaints.service.impl.ComplaintServiceImpl">
    		<property name="complaintResource">
    			<ref bean="complaintResource" />
    		</property>
    		<property name="processInstanceWorkflowResource">
    			<ref bean="workflowResource" />
    		</property>
    		<property name="swimlaneResource">
    			<ref bean="workflowResource" />
    		</property>
    		<property name="taskWorkflowResource">
    			<ref bean="workflowResource" />
    		</property>
    		<property name="taskManagerResource">
    			<ref bean="workflowResource" />
    		</property>
    		<property name="commentResource">
    			<ref bean="commentResource" />
    		</property>
    		<property name="swimlaneManagerResource">
    			<ref bean="swimlaneResource" />
    		</property>
    	</bean>
    	
    	
    	<bean name="addComplaintAdvisor" class="org.springframework.aop.support.NameMatchMethodPointcutAdvisor">
    		<property name="mappedNames">
    			<list>
    				<value>updateComplaintAndResume</value>
    				<value>createComplaint</value>
    			</list>
    		</property>
    		<property name="advice">
    			<ref bean="addComplaintAuditInterceptor"/>
    		</property>
    	</bean>
    	
    	<bean id="addComplaintAuditInterceptor" class="za.co.fnb.bis.complaints.service.AddComplaintAuditInterceptor"/>	
    	
    	<bean id="complaintsAuditResource" class="org.springframework.aop.framework.ProxyFactoryBean">
    		<property name="proxyInterfaces">
    			<value>za.co.fnb.bis.complaints.service.ComplaintService</value>
    		</property>
    		<property name="interceptorNames">
    			<list>
    				<value>addComplaintAdvisor</value>
    			</list>		
    		</property>
    		<property name="target">
    			<ref bean="complaintService"/>
    		</property>	
    	</bean>
    Can anyone see anything wrong with this? thanks
    Last edited by stirling; Mar 27th, 2008, 11:29 AM.

  • #2
    Which bean do you actually use? Can you show which bean you use and how the class looks like?
    If you, for example, get/inject the "complaintService" bean, then there exists no advice. You need the "complaintsAuditResource" bean.

    Comment


    • #3
      Thanks for your reply Andreas.

      The bean that I am using is the complaintService bean (za.co.fnb.bis.complaints.service.impl.ComplaintSe rviceImpl), the interface for this concrete class is za.co.fnb.bis.complaints.service.ComplaintService.

      Everytime the following methods: updateComplaintAndResume() and createComplaint() from the complaintService bean execute I would like the advice from addComplaintAuditInterceptor to fire, but this is not happening.

      I hope this sheds more light on my problem.
      Last edited by stirling; Mar 29th, 2008, 05:18 AM.

      Comment


      • #4
        As I already hinted, the "complaintService" bean knows nothing about your advice. The only bean that does is "complaintsAuditResource". You need to use that bean.

        Regards,
        Andreas

        Comment


        • #5
          Yes, I am now injecting complaintsAuditResource bean into my app instead of the complaintService and it's working. Thank you very much for your assistance.

          Comment

          Working...
          X