Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] LTW on weblogic not working

Have to admit I'm not an expert on this usage of AspectJ.

I was just reading:

http://springindepth.com/book/aop-load-time-weaving.html

That means the context:load-time-weaver will cause the spring
infrastructure to work out which weaver wrapper to use.  Seems like
that part is working since you mention seeing:

> LoadTimeWeaver - Determined server-specific load-time weaver:
> org.springframework.instrument.classloading.weblog ic.WebLogicLoadTimeWeaver

We could try turning on AspectJ trace which will tell us if the weaver
is actually launching. This page talks about what to turn on (I think
it is: -Dorg.aspectj.tracing.factory=default
Dorg.aspectj.tracing.enabled=true -Dorg.aspectj.tracing.messages=true)

http://www.eclipse.org/aspectj/doc/released/pdguide/trace.html

Depending on whether the weaver is launching we can tell if it is the
weaver not starting or an aop.xml file problem.

You might also want to try -verbose in the aop.xml, weaver options section.

Andy

On 22 September 2010 03:29, Timm Kristensen <timmkristensen@xxxxxxxxx> wrote:
> Hi aspect-users,
> I am trying to enable load time weaving in an application deployed on
> weblogic server 10.3.
> My problem is that as far as I can see AspectJ is not started up. Atleast
> nothing gets weaved.
> I am using spring 2.5.6 and aspectJ 1.5.4.
> I have added a aop.xml file to my META-INFO folder containing the following:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE aspectj PUBLIC "-//AspectJ//DTD//EN"
> "http://www.eclipse.org/aspectj/dtd/aspectj.dtd";>
> <aspectj>
>
>   <weaver options="-debug -showWeaveInfo">
>     <include within="dk.kk.tt..*" />
>   </weaver>
>
>   <aspects>
>     <aspect name="dk.kk.tt.ws.util.LogAdvice" />
>       <include within="dk.kk.tt.ws.utl.*"/>
>   </aspects>
>
> </aspectj>
>
> And enabled load time weaving through spring in the context file:
>
> <context:load-time-weaver/>
>
> My aspect is a simple logging timer, that is supposed to log the execution
> time of the executed methods of classes in a specific package.
>
> @Aspect
> public class LogAdvice {
>
>     private static org.apache.log4j.Logger log =
> org.apache.log4j.LogManager.getLogger(LogAdvice.class);
>
>     @Pointcut("execution(* dk.kk.tt.subscription..*.*(..)) || execution(*
> dk.kk.tt.productrelation..*.*(..))")
>     public void methodCallsInSubscriptionAndProductrelation(){
>     }
>
>     @Around("methodCallsInSubscriptionAndProductrelation()")
>     public Object doCallTiming(ProceedingJoinPoint proceedingJoinPoint)
> throws Throwable {
>         StopWatch sw = new StopWatch(getClass().getSimpleName());
>         try {
>             sw.start(proceedingJoinPoint.getSignature().getName());
>             return proceedingJoinPoint.proceed();
>         } finally {
>             sw.stop();
>             log.info(sw.prettyPrint());
>         }
>     }
> }
>
> It seems that the weaver is not applied to the classloader or something,
> because I can not see any activity in the log relating to AspectJ.
> The only info I get from the logs is the following :
> INFO 20 sep 14:03:34,159 org.springframework.context.weaving.DefaultContext
> LoadTimeWeaver - Determined server-specific load-time weaver:
> org.springframework.instrument.classloading.weblog ic.WebLogicLoadTimeWeaver
> Can anyone see what I am doing wrong ?
> Has anyone successfully enabled LTW on weblogic 10.X and how did you do it ?
> BTW. I already posted a question like this in the Spring forums, but have so
> far not received any answers.
> I hope that you can help me.
> Best regards
> /Timm
>
>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>


Back to the top