Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] Load-time weaving with Eclipse RCP application

Thanks Stephan for sending me the demo app.

I started it using the current AspectJ build aspectjweaver.jar (I
don't know which one you are using, but I haven't done any specific
fix for this to work recently)  and java5, with:

set MCLASSPATH=loglib.jar;startup.jar;.

java -javaagent:%AJH%\aspectjweaver.jar -cp %MCLASSPATH%
org.eclipse.core.launcher.Main


and I get :
(just add -verbose -showWeaveInfo in the weaver option in aop.xml)

arg0(class java.lang.String)= osgi.configuration.area
before: call(String java.lang.System.getProperty(String))
arg0(class java.lang.String)= osgi.baseConfiguration.area
before: call(String java.lang.System.getProperty(String))
arg0(class java.lang.String)= osgi.install.area
before: call(Class java.lang.Class.forName(String))
arg0(class java.lang.String)= org.eclipse.core.launcher.Main
before: call(String org.eclipse.core.launcher.Main.decode(String))
arg0(class java.lang.String)= /C:/Documents%20and%20Settings/avasseur/Bureau/RCP
demo/RCPDEMO1/eclipse/startup.jar
before: call(Class java.lang.Class.forName(String))
arg0(class java.lang.String)= java.net.URLDecoder
before: call(Class java.lang.Class.forName(String))
arg0(class java.lang.String)= java.lang.String
before: call(int java.lang.String.indexOf(int))
arg0(class java.lang.Integer)= 43
before: call(char java.lang.String.charAt(int))
arg0(class java.lang.Integer)= 0
before: call(boolean java.lang.Character.isUpperCase(char))
arg0(class java.lang.Character)= C
before: call(char java.lang.Character.toLowerCase(char))

I can't get it to run with rcpdemo.exe and -vmargs though - don't know
what's going on there (keeps failing complaining that the aspect from
aop.xml cannot be found ie is not in the classpath)

Alex

On 7/4/05, Stephan Kolp <stephan.kolp@xxxxxxxxxx> wrote:
> Hello,
> 
> The exact command line is
> 
>      java -javaagent:%ASPECTJ_HOME%\lib\aspectjweaver.jar
>           org.eclipse.core.launcher.Main
> 
> I use it from my product's directory which contains the META-INF
> directory with aop.xml
> 
> ASPECTJ_HOME=C:\Programme\_develop\AspectJ
> CLASSPATH=C:\temp\RCPDEMO\eclipse\loglib.jar;
>      C:\temp\RCPDEMO\eclipse\startup.jar;
>      C:\Programme\_develop\AspectJ\lib\aspectjrt.jar;.
> 
> loglib.jar contains my aspect and startup.jar contains the class which I
> start from the command line.
> 
> I also tried to start the product's exe with
> 
>      rcpdemo -consolelog
>          -vmargs -javaagent:%ASPECTJ_HOME%\lib\aspectjweaver.jar
> 
> but even with <include within="*"/> I didn't get any output from the apsect.
> 
> Thanks, Stephan
> 
> 
> Alexandre Vasseur schrieb:
> > Hi
> >
> > Can you send me the exact command line you are using asuming f.e. you
> > have ASPECTJ_HOME and ECLIPSE_HOME set ?
> >
> > I am not familiar with that but I would assume you need to use -vmargs
> > Eclipse option and sort of.
> > Thanks
> >
> > On 7/1/05, Stephan Kolp <stephan.kolp@xxxxxxxxxx> wrote:
> >
> >>Hello,
> >>
> >>I posted this problem to eclipse.technology.aspectj and I was suggested
> >>to post
> >>it here:
> >>
> >>I want to use load-time weaving with an Eclipse RCP Application and
> >>the -javaagent:aspectweaver.jar option but it doesn'nt work as it should.
> >>
> >>I start the application with
> >>
> >>java -javaagent:%ASPECTJ_HOME%\lib\aspectweaver.jar
> >>   org.eclipse.core.launcher.Main
> >>
> >>My aop.xml looks like this:
> >>
> >><aspectj>
> >>  <aspects>
> >>    <aspect name="util.logging.LoggingAspect"/>
> >>  </aspects>
> >>  <weaver options=" -nowarn">
> >>    <include within="rcpdemo.*"/>
> >> </weaver>
> >></aspectj>
> >>
> >>
> >>My aspect generates an output before any method call. This works fine for
> >>simple java applications but not for RCP applications. Allthough I get a
> >>lot
> >>of messages that classes are going to be woven (e. g.
> >>WeavingAdaptor.weaveClass org/eclipse/ui/internal/PerspectiveHelper) the
> >>desired output from the aspect does not appear.
> >>
> >>When I change the 'include within' attribute of aop.xml to "*" I get the
> >>same WeavingAdaptor messages and additional output from my aspect. But the
> >>aspect does not create output from method calls within any plugin. The
> >>output appears only for method calls within the eclipse launcher in the
> >>startup.jar.
> >>
> >>I know about the AJEER plugin but it works only with the AJDT 1.1.12 which
> >>are available for Eclipse 3.0. But is there any possibility to use
> >>load-time
> >>weaving with RCP applications developed with Eclipse 3.1 and upcoming
> >>versions?
> >>
> >>Regards, Stephan
> >>_______________________________________________
> >>aspectj-dev mailing list
> >>aspectj-dev@xxxxxxxxxxx
> >>https://dev.eclipse.org/mailman/listinfo/aspectj-dev
> >>
> >
> > _______________________________________________
> > aspectj-dev mailing list
> > aspectj-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/aspectj-dev
> >
> _______________________________________________
> aspectj-dev mailing list
> aspectj-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
>


Back to the top