[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] weave all methods in rt.jar

I think you have to take a little care when weaving rt.jar - for example if your advice uses types you will be weaving then you will end up in a loop (the advice gets called, calls back into the type you advised, which in turns calls back into the advice, etc, etc). It might be the java/lang/Object issue you are seeing is a manifestation of this problem. I would target a specific simple type that you know your advice won't be touching and verify your weave/run_with_woven is basically working before broadly applying it across the JDK, and even then you'll probably want to exclude some types (String, Object, etc).


On Sun, 29 Jul 2018 at 20:01, Sui, Li <L.Sui@xxxxxxxxxxxx> wrote:

Hi there

I would like to instrument all methods in rt.jar. Here is my codeÂ

public aspect CallInterceptor {
pointcut allMethods():
    !within(CallInterceptor) && execution(* *(..));

  before() : allMethods() {
 ÂÂSignature sig=thisJoinPointStaticPart.getSignature();
 ÂÂString method=sig.getDeclaringTypeName()+"."+sig.getName();
 ÂÂSystem.out.println("enter "+method);  Â   Â

  after() : allMethods() {

After weaving, I prepended weaved rt.jar toÂboot classpath and got the following error:
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object

any help would be appreciated.


aspectj-users mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit