Announcement Announcement Module
No announcement yet.
AOP can not work fine.... Page Title Module
Move Remove Collapse
Conversation Detail Module
  • 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 id="logDwnMessageAdvice" class="aaa.util.LogDwnMessageAdvice">
    <property name="dwnLog"><ref bean="dwnLog"/></property>

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

    <aopointcut id="logExMessage" expression="execution(* aaa..*(..))"/>
    <aopointcut id="logUpMessage" expression="execution(*"/>
    <aopointcut id="logDwnMessage" expression="execution(* (..))"/>
    <aop:advisor pointcut-ref="logExMessage" advice-ref="logExMessageAdvice" />
    <aop:advisor pointcut-ref="logUpMessage" advice-ref="logUpMessageAdvice" />
    <aop:advisor pointcut-ref="logDwnMessage" advice-ref="logDwnMessageAdvice" />

    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...