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

Andy


On Sun, 29 Jul 2018 at 20:01, Sui, Li <l....@massey.ac.nz> 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() {
>     System.out.println("exit");
>     }
> }
>
>
> 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.
>
> Cheers
> Li
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@eclipse.org
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
_______________________________________________
aspectj-users mailing list
aspectj-users@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/aspectj-users

Reply via email to