[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Réf. : RE: Réf. : RE: Réf. : Re: Re :[aspectj-users] aspect on a java API class


Hi,

I added, Xlint.properties. The result is there are a little bit less logs than what I send

Laurent Delaforge



<hermod.opstvedt@xxxxxxxxx>
Envoyé par : aspectj-users-bounces@xxxxxxxxxxx

03/03/2008 12:02
Veuillez répondre à aspectj-users

       
        Pour :        <aspectj-users@xxxxxxxxxxx>
        cc :        (ccc : Laurent Delaforge/ODDO)
        Objet :        RE: Réf. : RE: Réf. : Re: Re :[aspectj-users] aspect on a java API class



Hi
 
Add in the Xlint.properties file also - It will give you additional information
 
Hermod
-----Original Message-----
From:
aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of ldelaforge@xxxxxxx
Sent:
Monday, March 03, 2008 11:35 AM
To:
aspectj-users@xxxxxxxxxxx
Cc:
aspectj-users@xxxxxxxxxxx; aspectj-users-bounces@xxxxxxxxxxx
Subject:
Réf. : RE: Réf. : Re: Re :[aspectj-users] aspect on a java API class


Thank you for your help,


I tried this, but there is not even trace of the weaving of BigDecimal.

It is a real mystery for me, so I give all the code :


Here is my aop.xml :

<!DOCTYPE
aspectj PUBLIC "-//AspectJ//DTD 1.5.0//EN" "http://www.eclipse.org/aspectj/dtd/aspectj_1_5_0.dtd">
<aspectj>

 
<weaver options="-Xset:weaveJavaPackages=true -proceedOnError -Xlintfile:META-INF/Xlint.properties -showWeaveInfo -verbose -debug">
 
<exclude within="org.apache.commons.logging..*"/>
 
<include within="test.aop.beans..*"/>
 
<include within="java..*"/>
 
</weaver>
 
<aspects>
   
<aspect name="test.aop.AppAspect"/>
 
</aspects>
</aspectj>

Here is my Aspect :

@Aspect

public class AppAspect {

   @After("execution(* java.math.BigDecimal.valueOf(..))")

   public void afterBigDecimal(JoinPoint jp) {

       System.out.println("grouik BigDecimal");

   }

   
   @After("execution(* test.aop.beans.*.copyFrom(..))")

   public void afterBeans(JoinPoint jp) {

       System.out.println("grouik beans");

   }

}


Here is my test :

@Test

public void getAndSetOnArrayList() throws Exception {

 System.out.println("-------- mytest ----------");

 client01.copyFrom();

 BigDecimal bd = BigDecimal.valueOf(0);

 bd = new BigDecimal(5);

}


Here is the resulting log (I cutted the middle) :

[AppClassLoader@1f12c4e] info AspectJ Weaver Version DEVELOPMENT built on Thursday Feb 28, 2008 at 22:30:47 GMT

[AppClassLoader@1f12c4e] info register classloader sun.misc.Launcher$AppClassLoader@1f12c4e

[AppClassLoader@1f12c4e] info using configuration /D:/perso/arbo%20mes%20documents/informatique/developpement/tests/AOP/07/target/test-classes/META-INF/aop.xml

[AppClassLoader@1f12c4e] warning Cannot access resource for -Xlintfile:META-INF/Xlint.properties

[AppClassLoader@1f12c4e] info register aspect test.aop.AppAspect

[AppClassLoader@1f12c4e] debug not weaving 'org.eclipse.jdt.internal.junit.runner.RemoteTestRunner'

[AppClassLoader@1f12c4e] debug not weaving 'org.eclipse.jdt.internal.junit.runner.MessageSender'


..............


[AppClassLoader@1f12c4e] debug cannot weave 'org.aspectj.runtime.reflect.AdviceSignatureImpl'

[AppClassLoader@1f12c4e] debug cannot weave 'org.aspectj.lang.reflect.AdviceSignature'

-------- mytest ----------

grouik beans

[AppClassLoader@1f12c4e] debug cannot weave 'org.aspectj.runtime.reflect.CatchClauseSignatureImpl'

[AppClassLoader@1f12c4e] debug cannot weave 'org.aspectj.lang.reflect.CatchClauseSignature'

[AppClassLoader@1f12c4e] debug cannot weave 'org.aspectj.runtime.reflect.FieldSignatureImpl'

[AppClassLoader@1f12c4e] debug cannot weave 'org.aspectj.lang.reflect.FieldSignature'

[AppClassLoader@1f12c4e] debug cannot weave 'org.aspectj.runtime.reflect.InitializerSignatureImpl'

[AppClassLoader@1f12c4e] debug cannot weave 'org.aspectj.lang.reflect.InitializerSignature'

[AppClassLoader@1f12c4e] debug cannot weave 'org.aspectj.runtime.reflect.SignatureImpl$Cache'

[AppClassLoader@1f12c4e] debug cannot weave 'org.aspectj.runtime.reflect.JoinPointImpl$StaticPartImpl'

[AppClassLoader@1f12c4e] debug cannot weave 'org.aspectj.runtime.reflect.SourceLocationImpl'
[AppClassLoader@1f12c4e] debug not weaving 'org.springframework.util.NumberUtils'

[AppClassLoader@1f12c4e] debug not weaving 'org.springframework.core.NestedExceptionUtils'

[AppClassLoader@1f12c4e] debug not weaving 'org.junit.internal.runners.TestMethodRunner'

[AppClassLoader@1f12c4e] debug not weaving 'org.junit.Ignore'

[AppClassLoader@1f12c4e] debug not weaving 'org.junit.runner.notification.RunNotifier$3'

[AppClassLoader@1f12c4e] debug not weaving 'org.junit.runner.notification.RunNotifier$SafeNotifier'

[AppClassLoader@1f12c4e] debug cannot weave 'org.aspectj.runtime.reflect.JoinPointImpl'

[AppClassLoader@1f12c4e] debug weaving 'test.aop.AppAspect'

[AppClassLoader@1f12c4e] debug cannot weave 'org.aspectj.lang.NoAspectBoundException'

[AppClassLoader@1f12c4e] debug not weaving 'org.junit.runner.notification.RunNotifier$6'





<hermod.opstvedt@xxxxxxxxx>
Envoyé par : aspectj-users-bounces@xxxxxxxxxxx

03/03/2008 10:43
Veuillez répondre à aspectj-users

       
       Pour :        <aspectj-users@xxxxxxxxxxx>

       cc :        (ccc : Laurent Delaforge/ODDO)

       Objet :        RE: Réf. : Re: Re :[aspectj-users] aspect on a java API class




Hi

 

Try: <weaver options="-proceedOnError -Xlintfile:META-INF/Xlint.properties -showWeaveInfo -verbose -debug"> in you aop.xml file. The check the log files to see if you class is wowen. ALso remember to include java.math.** in you includes section of aop.xml

 

Hermod

-----Original Message-----
From:
aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of ldelaforge@xxxxxxx
Sent:
Monday, March 03, 2008 10:28 AM
To:
aspectj-users@xxxxxxxxxxx
Cc:
aspectj-users-bounces@xxxxxxxxxxx
Subject:
Réf. : Re: Re :[aspectj-users] aspect on a java API class



I downloaded the "
Last Known Good developer build" : aspectj-DEVELOPMENT-20080228164011.jar

Because I'm using LTW, I didn't installed it :

I only took the aspectjweaver.jar, uploaded it in my maven repo, and changed the version in my pom.xml (1.5.4 to DEVELOPMENT-20080228164011).


In my aop.xml, I changed
<weaver>...</weaver> by <weaver options="-Xset:weaveJavaPackages=true">...</weaver>

But when I execute my code, the advise is still not executed...


Did I miss something ?


"Andy Clement" <andrew.clement@xxxxxxxxx>
Envoyé par : aspectj-users-bounces@xxxxxxxxxxx

29/02/2008 20:41
Veuillez répondre à aspectj-users

       
      Pour :        aspectj-users@xxxxxxxxxxx

      cc :        (ccc : Laurent Delaforge/ODDO)

      Objet :        Re: Re :[aspectj-users] aspect on a java API class





Weaving of java. and javax. types has been discussed on the list
recently.  You need an up to date AspectJ and you need to use a weaver
option to force it to weave those types in addition to normal
configuration info.  The Javax one is shown below, the
weaveJavaPackages=true option is what you need.

Andy.

> I think you are possibly being affected by the code we have that
> prevents LTW of anything beginning java.* or javax.* :)  See this
> bugzilla entry from a while back
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=149261 : "Allow weaving
> javax..* types"
>
> In which case, you need to download a recent dev build of AspectJ from
> the downloads page and use the option:
>
> <weaver options="-Xset:weaveJavaxPackages=true"/>
>
> Andy.

On 29 Feb 2008 19:12:55 -0000, Kunal Pathak
<kunalpathak2006@xxxxxxxxxxxxxx> wrote:
> Hi Laurent ,
>
> I tried a "without annotation" approach for load time weaving and i could
> execute an advice code for the joinpoint you mentioned. Can you please try
> out using simple aj command or you want to use the annotation? I mean I
> don't think it's the problem due to annotation, but still want to know.
>
> Thanks,
> Kunal.
>
> On Fri, 29 Feb 2008 17:59:18 +0100 aspectj-users@xxxxxxxxxxx wrote
>
>
>  Hi all,
>
>
>
>  I am (still) trying to put a joinpoint on a java API class :
> java.math.BigDecimal
>
>  I try to do it with load time weaving LTW (with a JavaAgent)
>
>
>
>  My aspect is like this :
>
>  @Aspect
>
>  public class AppAspect {
>
>      @After("execution(* java.math.BigDecimal.valueOf(..))")

>
>                          public void afterBigDecimal(JoinPoint jp) {
>
>                                  System.out.println("grouik BigDecimal");
>
>      }
>
>  }
>

>
>
>  And, because I know it is normally not authorized to do it,
>
>  I bypass the loading of the BigDecimal of the rt.jar, by bootloading an
> extracted java.math.BigDecimal.
>
>  I do it by adding in the JVM parameters -Xbootclasspath/p:"D:... arget
> est-classes emp"
>
>  where ... emp contains javamathBigDecimal.class
>
>
>
>
>  But when I execute this, the advise is not executed...
>
>
>
>  Is the bypass a good solution ? If yes, why does it not working ? If no, is
> there another way ?
>
>
>
>  Thanks in advance.
>
>
>
>  Laurent Delaforge
>
>
>
>  Attention:
>  L'integrite de ce message n'etant pas assuree sur Internet, les societes du
> groupe ODDO ne peuvent etre tenues responsables de son contenu. Ce message

> et les eventuels fichiers attaches contiennent des informations
> confidentielles. Au cas ou il ne vous serait pas destine, nous vous
> remercions de bien vouloir le supprimer et en aviser l'expediteur.
>  This message and the files that may be attached to it contain confidential
> information. The ODDO group may not be held responsible for their contents,
> whose accuracy and completeness cannot be guaranteed over the internet. If
> the message is not addressed to you, kindly delete it and notify the sender.
>
>
>
> _______________________________________________
>  aspectj-users mailing list
>  aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



Attention:

L'integrite de ce message n'etant pas assuree sur Internet, les societes du groupe ODDO ne peuvent etre tenues responsables de son contenu. Ce message et les eventuels fichiers attaches contiennent des informations confidentielles. Au cas ou il ne vous serait pas destine, nous vous remercions de bien vouloir le supprimer et en aviser l'expediteur.

This message and the files that may be attached to it contain confidential information. The ODDO group may not be held responsible for their contents, whose accuracy and completeness cannot be guaranteed over the internet. If the message is not addressed to you, kindly delete it and notify the sender.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that the DnB NOR Group
cannot accept any payment orders or other legally binding correspondence with
customers as a part of an email.

This email message has been virus checked by the anti virus programs used
in the DnB NOR Group.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


 

Attention:

L'integrite de ce message n'etant pas assuree sur Internet, les societes du groupe ODDO ne peuvent etre tenues responsables de son contenu. Ce message et les eventuels fichiers attaches contiennent des informations confidentielles. Au cas ou il ne vous serait pas destine, nous vous remercions de bien vouloir le supprimer et en aviser l'expediteur.

This message and the files that may be attached to it contain confidential information. The ODDO group may not be held responsible for their contents, whose accuracy and completeness cannot be guaranteed over the internet. If the message is not addressed to you, kindly delete it and notify the sender.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

This email with attachments is solely for the use of the individual or
entity to whom it is addressed. Please also be aware that the DnB NOR Group
cannot accept any payment orders or other legally binding correspondence with
customers as a part of an email.

This email message has been virus checked by the anti virus programs used
in the DnB NOR Group.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users



 

Attention:

L'integrite de ce message n'etant pas assuree sur Internet, les societes du groupe ODDO ne peuvent etre tenues responsables de son contenu. Ce message et les eventuels fichiers attaches contiennent des informations confidentielles. Au cas ou il ne vous serait pas destine, nous vous remercions de bien vouloir le supprimer et en aviser l'expediteur.

This message and the files that may be attached to it contain confidential information. The ODDO group may not be held responsible for their contents, whose accuracy and completeness cannot be guaranteed over the internet. If the message is not addressed to you, kindly delete it and notify the sender.