Announcement Announcement Module
No announcement yet.
load time weaver and tomcat 6 problem! Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • load time weaver and tomcat 6 problem!

    Dear Spring community

    what have i missed?

    I am trying to get load-time-weaver working in spring 3
    on tomcat 6 in eclipse Eclipse Java EE IDE for Web Developers.

    Build id: 20090920-1017

    i have followed the instructions given here

    7.8.4 Load-time weaving with AspectJ in the Spring Framework

    heres my aspect

    import org.aspectj.lang.ProceedingJoinPoint;
    import org.aspectj.lang.annotation.Around;
    import org.aspectj.lang.annotation.Aspect;
    import org.aspectj.lang.annotation.Pointcut;

    public class KevynAucoin extends BaseAspect {

    * A join point is in the Data Access Object layer if the method is defined
    * in a type in the package or any
    * sub-package under that.
    public void inDataAccessObjectLayer() {

    * the execution of any method with a name beginning with "set"
    public void setBeechey() {

    public Object doSetting(ProceedingJoinPoint pjp) throws Throwable {
    Object retVal = pjp.proceed();
    return retVal;


    heres my aop.xml in META-INF
    <!DOCTYPE aspectj PUBLIC
    "-//AspectJ//DTD//EN" "">


    <!-- only weave classes in our application-specific packages -->
    <include within="*" />



    <!-- weave in just this aspect -->
    <aspect name="" />



    this my spring config for aspect

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns=""
    xmlns:xsi="" xmlns:context=""

    <bean id="preSchoolPresentationAspects" class="" />

    <!-- this switches on the load-time weaving -->
    <context:load-time-weaver />


    heres my tomcat 6 context.xml

    <Context path="/Aardvark">
    <Loader loaderClass="org.springframework.instrument.classl oading.tomcat.TomcatInstrumentableClassLoader"/>

    the thing is my tomcat 6 install doesnt appear to have a $CATALINA_HOME/server/lib folder! why is that?

    so i cant follow this instruction
    "Copy org.springframework.instrument.tomcat.jar into $CATALINA_HOME/server/lib, where $CATALINA_HOME represents the root of the Tomcat installation."

    so i put this jar "org.springframework.instrument.tomcat-3.0.0.RELEASE.jar"
    in the $CATALINA_HOME/lib folder

    one question i have is... how do you work out what your docbase is in this

    <Context path="/myWebApp" docBase="/my/webApp/location">
    loaderClass="org.springframework.instrument.classl oading.tomcat.TomcatInstrumentableClassLoader"/>

  • #2
    moving on

    I have now managed to get aspects working fine...

    As long as i always follow these steps

    1). Clean Tomcat server
    2). Start server
    3). Test ... everything ok

    if i now stop and start the tomcat server (without clean)
    the aspects do not get weaved!

    This is within eclipse (galileo)

    Why Why Why ? do i have to clean before every server start?