Announcement Announcement Module
Collapse
No announcement yet.
sprng ltw weaver in web app Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • sprng ltw weaver in web app

    Hi,

    I can't make LTW working with Spring rc3 and Aspectj 1.5.2a.
    Is the problem in using LTW together with "autoproxy with cglib forced" ?
    I was able to make the web app deloy in tomcat, but I don't see any advice being envoked.
    I don't seee any weaver trace either, despite "dump" tag specified in aop.xml.

    any advice will be highly appreciated.

    Thanks,

    Alex

    Relevant code fragments are as follows


    ---- aop.xml ------


    <aspectj>
    <weaver options="-verbose, -showWeaveInfo,
    -XmessageHandlerClass:org.springframework.aop.aspec tj.AspectJWeaverMessageHandler">
    <include within="a.b.c.web..*"/>
    <include within="org.springframework.web.servlet..*" />
    <dump within="a.b.c.web..*"/>
    </weaver>

    <aspects>
    <aspect name="a.b.c.logic.aop.PerServlet" />
    <aspect name="a.b.c.logic.aop.PerServletAdvice" />

    </aspects>


    </aspectj>

    --- spring config -----
    <?xml version="1.0" encoding="UTF-8"?>
    <beans
    .......................
    >

    <bean class="a.b.c.logic.aop.PerServlet" />
    <bean class="a.b.c.logic.aop.PerServletAdvice" />

    <aop:aspectj-autoproxy proxy-target-class="true"/>
    <aop:spring-configured/>


    </beans>


    ------------- pointcut -------------------
    @Aspect
    public class PerServlet {

    @Pointcut(" execution " +
    "" +
    "( public * a.b.c.web.controller.*.*(..) ) " )
    public void someCall() {}


    }

    --------- advice ---------

    @Aspect
    public class PerServletAdvice {


    @Around("a.b.c.logic.aop.PerServlet.someCall()")
    public Object aroundAdviceTest(ProceedingJoinPoint jp) throws Throwable {

    System.out.println( "__ OK__" );
    Object[] args = jp.getArgs();


    System.out.println( "Entering method :" + jp.getSignature().getName()
    + "request=" + args[0].toString()
    + "response=" + args[1].toString() );

    Object ret = null;
    try {
    ret = jp.proceed(new Object[]{jp.getTarget()});
    System.out.println( "returned=" + ret );
    } catch ( Throwable th ){
    throw th;
    }
    return ret;

    }

    ----------------------- tomcat jvm parameters --------------

    -javaagent:C:/aspectjweaver-1.5.2a.jar
    -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.5
    -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 5.5
    -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed
    -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 5.5\temp
    -Djava.util.logging.manager=org.apache.juli.ClassLo aderLogManager
    -Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\logging.properties
    -Dsbsoft.log.dir=C:\Tomcat\logs
    -Dsbsoft.data.dir=C:\deployer\data
    -XX:PermSize=67m
    -XX:MaxPermSize=256m
    -Xms128m
    -Xmx1000m

    aspectjweaver-1.5.2a.ja and aspcjrt-1.5.2a.jar are also placed on tomcat classpath

  • #2
    Well, META-INF/aop.xml was placed under web app deployment root which apparenly is not on tomcat classpath. If META-INF/aop.xml is located in

    <root>/WEB-INF/classes/META-INF

    or in any jar inside

    <root>/WEB-INF/lib


    everything works fine

    Comment

    Working...
    X