Announcement Announcement Module
Collapse
No announcement yet.
AOP can not work fine.... Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • AOP can not work fine....

    Hi, I try to implement simple logging with log4j upon Spring 2.0 AOP, but not works fine.

    Here is my configuration as below:

    <bean id="logUpMessageAdvice" class="aaa.util.LogUpMessageAdvice">
    <property name="upLog"><ref bean="upLog"/></property>
    </bean>

    <bean id="logDwnMessageAdvice" class="aaa.util.LogDwnMessageAdvice">
    <property name="dwnLog"><ref bean="dwnLog"/></property>
    </bean>

    <bean id="logExMessageAdvice" class="aaa.util.LogExMessageAdvice">
    <property name="errLog"><ref bean="errLog"/></property>
    </bean>

    <aop:config>
    <aopointcut id="logExMessage" expression="execution(* aaa..*(..))"/>
    <aopointcut id="logUpMessage" expression="execution(* aaa.channel.RequestChannelHandler.send(..))"/>
    <aopointcut id="logDwnMessage" expression="execution(* aaa.handler.channel.ResponseChannelHandler.receive (..))"/>
    <aop:advisor pointcut-ref="logExMessage" advice-ref="logExMessageAdvice" />
    <aop:advisor pointcut-ref="logUpMessage" advice-ref="logUpMessageAdvice" />
    <aop:advisor pointcut-ref="logDwnMessage" advice-ref="logDwnMessageAdvice" />
    </aop:config>

    aaa.util.LogDwnMessageAdvice implements MethodBeforeAdvice, and aaa.util.LogUpMessageAdvice implements AfterReturningAdvice, and aaa.util.LogExMessageAdvice implements ThrowsAdvice. All the xxxLog properties are Loggers.

    But the LogDwnMessageAdvice, LogExMessageAdvice can not work only the LogUpMessageAdvice works fine.

    I found one funny thing that I changed the JDK to 6.0 all things work pretty good, but in JDK 1.5 just only the LogUpMessageAdvice works......

    Please help me...
Working...
X