Announcement Announcement Module
No announcement yet.
Spring AOP not getting invoked on Listener class Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring AOP not getting invoked on Listener class

    I am trying to log the incoming and out messages through an SMPP Channel.
    So i have a Observer attached to this SMPP Channel, all loaded as a spring bean.

    Now on the Observer/Listener class i have configured point-cut for the methods and associated an Advice.

    Whenever any incoming messages comes to the SMPP channel, the Listener class's method is invoked, but the advice does not get triggered. When i moved same advice to another point-cut one layer at the business services. i.e. once the listener receives the messages and delegates to the business service. The advice gets invoked.

    From the logs the Listener class is run by dameon thread..

    <bean name="smppChannel" class="com.demo.smpp.SMPPChannel" init-method="init">
    	<property name="observer" ref="smppListener" />
    <bean name="smppListener" class="com.demo.smpp.SMPPListener"/>
    <bean name="transactionLogger" class="com.demo.advice.TransactionLogger"/>
         <aop:aspect ref="transactionLogger">
               <aop:pointcut id="transaction" expression="execution(* com.demo.smpp.SMPPListener.*(..))"/>
         <aop:before pointcut-ref="transaction" method="logSMPPTransaction"/>
    i just have a log statement in the logSMPPTransaction method in the TransactionLogger class.

    Any help on this would be appreciated..


  • #2
    Ignore my post. I figured out the issue, the methods i was expecting to match the point-cut expression was not part of the interface. I forced it to use the CGLIB instead of jdk proxies. It worked..

    Thanks for your time..