Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] aspect reweaving error

 
Hi Andrian,
 
Sorry for being late replying to below mail.
 
When some binary is given for weaving, user clear on which aspects should be woven into it.
So -aspectpath option is better way to deal with above requirement. Whatever user has put in
-aspectpath option, should be woven into binaries. In this way if user wish to remove OR add any aspect
effect, it can be easily done by adding/removing aspects from aspectpath (and putting previously woven aspects in classpath,
if not present in -aspectpath)So I feel the behavior of 1.2.1 is better than 1.5.x. I am not seeing any dis-advantage with 1.2.1 behavior.
 
Now for third party woven Jars, aspect class must be present along with Jar file. So if user wish to keep the effect of previously woven aspect
he can add it in -aspectpath, and if he do not want he will remove. Only point which can be enforced on such woven jar is the list of woven aspects
should be present in aop.xml so that someone can know which aspects are already woven.
 
I would like to see 1.5.2 behavior same as 1.2.1. I would like to understand the advantages of 1.5.x, reweaving behavior.
 
Regards,
Jitesh
 
 
 
Date: Fri, 19 May 2006 08:47:40 +0100
From: "Adrian Colyer" <
adrian.colyer@xxxxxxxxx>
Subject: Re: [aspectj-users] aspect reweaving error
To:
aspectj-users@xxxxxxxxxxx
Message-ID:
<
7079d79e0605190047p663ad30diabaf231bae51c45f@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="iso-8859-1"

Of course. That message is actually more than just misleading, it has
changed the reweaving preconditions across the board (and not
intentionally). I'm interested to hear users opinions on the two options
here:

* In 1.2.1, given a type T previously woven with aspect A1, and subsequently
binary weaving with just A2 on the aspectpath, then as long as A1 could be
found on classpath, inpath, (or aspectpath) the reweaving of T would
proceed. This does *not* mean that the effects of A1 were removed from T
(even in your case with 1.2.1 Kalyani, I would expect T to still be woven
with A1 in this circumstance). If the version of A1 found on the classpath
during this process is different to the original version of A1 that was
woven into T in the first instance, it is the new version of A1 (the one
found on the classpath) that is used during the reweaving process.

* In 1.5.x, given a type T previously woven with aspect A1, and subsequently
binary weaving with just A2 on the aspectpath, we give an error. Forcing A1
to be explicitly placed on the aspectpath makes it clearer (you could argue)
what the semantics are. It can also be a pain if say you just want to weave
into a third-party jar that has some aspects already woven into it.

Any views as to which way folks would like 1.5.2 to work?

Thanks, Adrian.


On 17/05/06, Kalyani Jitesh <
j-kalyani@xxxxxxxxxxxxxxxxx> wrote:
>
> Hi Andrian,
>
> Thank you very much for your inputs.
> Ohh!! really that message was confusing. It has mislead me to use aop.xml.
>
> Ok. I have understood the way I can remove effect of aspect1.class from
> woven binary and reweave the aspect2.class.
>
> I have found that above implementation is not same as in case of version -
> 1.2.l. In version 1.2.1, I  can reweave the aspect2.class alone Or
> together
> with apsect1.class. And I think the bevaviour of 1.2.1 is more meaningful
> and helpful. As it is reweaving with any aspects given in -aspectpath.
>
> Would like to know why this bevaviour is changed? Any advantages with
> implementation change in 1.5.1a, rather I see it as dis-advantage, as I
> have
> to create empty aspect to remove the effect?
>
> Regards,
> Jitesh
>
>
> > Date: Tue, 16 May 2006 09:14:11 +0100
> > From: "Adrian Colyer" <
adrian.colyer@xxxxxxxxx>
> > Subject: Re: [aspectj-users] aspect reweaving error
> > To:
aspectj-users@xxxxxxxxxxx
> > Message-ID:
> > <
7079d79e0605160114w3e755ba2l734668be232c571f@xxxxxxxxxxxxxx>
> > Content-Type: text/plain; charset="iso-8859-1"
> >
> >>I am executing the command as below,
> >>
> >>COMMAND: ajc -inpath woven_hello1.jar -aspectpath aspect2.jar -outjar
> > woven_hello2.jar
> >
> > Aha! That's interesting. I had assumed you were doing LTW from the
> > discussion of aop.xml. You've fallen victim of an inappropriate compiler
> > message. It is true that you must define aspect1 to the weaver, but the
> > message you're getting:
> >
> >> woven_hello1.jar [error] aspect 'aspect1' woven into 'Hello' must be
> > declared in an aop.xml file.
> >
> > should only be issued in this form when doing load time weaving: the
> > aop.xmlfile is currently only used when doing load-time weaving, so
> > whatever you
> > put in there is going to make no difference to the command you are
> > executing.
> >
> > You need to add aspect1.jar to the *aspectpath* (not the classpath) for
> > this
> > command to work.
> >
> > If you want to 'remove' all effects of the aspects in aspect1.jar - as
> > opposed to weaving the aspects in aspect2.jar in addition to those in
> > aspect1.jar then you can do this by creating e.g. aspect1-remove.jarwhich
> > contains all the same aspect types as aspect1.jar, but with no content
> in
> > the aspect types.
> >
> > For example:
> >
> > public aspect SomeAspectPreviouslyPackagedInAspect1Jar {
> >  // deliberately empty
> > }
> >
> >
> > Now put aspect1-remove.jar on the aspectpath instead of aspect1.jar.
> This
> > will have the effect of 'removing' any advice etc. that was woven as a
> > result of weaving with the previous versions of these types.
> >
> > I've raised bug 141945
> > (
https://bugs.eclipse.org/bugs/show_bug.cgi?id=141945)
> > to cover the confusing error message that you were seeing.
> >
> > Regards, Adrian.
> >
> > On 15/05/06, Kalyani Jitesh <
j-kalyani@xxxxxxxxxxxxxxxxx> wrote:
> >>
> >>  Hi Adrian,
> >>
> >> Thank you very much for your reply. But It did not solve my problem.
> >> I want to weave aspect2.jar only in woven_hello1.jar, My goal is to
> weave
> >> aspect2.jar and remove previously woven aspect1.jar from binary. Is it
> >> possible? Sorry my goal was not clear from previous mail.
> >>
> >> As I have mentioned in my previous mail I have the aop.xml which look
> as
> >> below,
> >> which is placed in my 1st time woven archive, woven_hello1.jar,
> >> <aspectj>
> >>   <aspects>
> >>   <aspect name="aspect1"/>
> >>   </aspects>
> >> </aspectj>
> >> I have also tried,
> >> <aspectj>
> >>   <aspects>
> >>   <aspect name="aspect1"/>
> >>   <aspect name="aspect2"/>
> >>   </aspects>
> >> </aspectj>
> >>
> >> Both above case did not work.
> >>
> >> I am executing the command as below,
> >>
> >> COMMAND: ajc -inpath woven_hello1.jar -aspectpath aspect2.jar -outjar
> >> woven_hello2.jar
> >>
> >> I am getting same old error,
> >> woven_hello1.jar [error] aspect 'aspect1' woven into 'Hello' must be
> >> declared in an aop.xml file.
> >> (no source information available)
> >> I have placed both aspect1.class and aspect2.class in CLASSPATH system
> >> variable.
> >>
> >> Can you please help me to resolve the problem. Thanks in advance.
> >>
> >> Regards,
> >> Jitesh
> >>
> >>
> >> Date: Fri, 12 May 2006 09:58:35 +0100
> >> From: "Adrian Colyer" <
adrian.colyer@xxxxxxxxx>
> >> Subject: Re: [aspectj-users] aspect reweaving error
> >> To:
aspectj-users@xxxxxxxxxxx
> >> Message-ID:
> >> <
7079d79e0605120158j77b7d02cv655cb3f077ecee74@xxxxxxxxxxxxxx>
> >> Content-Type: text/plain; charset="iso-8859-1"
> >>
> >> When you are doing the second weave, you need to add
> >>
> >>   <aspect name="aspect1"/>
> >>
> >> into the <aspects> section of your aop.xml. AspectJ requires both any
> >> aspects that types were originally woven with to be defined in addition
> >> to
> >> any new aspects.
> >>
> >> On 12/05/06, Kalyani Jitesh <
j-kalyani@xxxxxxxxxxxxxxxxx> wrote:
> >> >
> >> >  HI There,
> >> >
> >> > Am trying to reweave the aspects in woven application archive with
> >> > aspectJ1.5.1a version.
> >> >  I have followed the following steps,
> >> >
> >> > 1. At 1st I have woven aspect1.class in woven_hello.jar compile time
> >> using
> >> > ajc compiler. (aspct is woven with -reweavable option as it on by
> >> default in
> >> > aspectJ1.5.1a). I have placed the below aop.xml in woven_hello.jar in
> >> > META-INF folder.
> >> >
> >> > <aspectj>
> >> >  <aspects>
> >> >   <aspect name="aspect1"/>
> >> >  </aspects>
> >> > </aspectj>
> >> > 2. Then I have tried weaving aspect2.class in woven_hello.jar (which
> is
> >> > already woven with aspect1.class). During this step I have put the
> >> > aspect1.class in CLASSPATH.
> >> >
> >> > After step 2 I am getting below error:
> >> >
> >> >
> >>
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------
> >> > D:\javasample\inheritance\wnoffice1.jar [error] aspect 'aspect1 woven
> >> into
> >> > 'Hello' must be declared in an aop.xml file.
> >> > (no source information available)
> >> >
> >> >
> >>
> --------------------------------------------------------------------------------------------------------------------------------------------------------------------
> >> > Can anyone guide me how can I reweave aspect2.class in
> woven_hello.jar
> >> > after step1?
> >> > Thanks in advance.
> >> >
> >> > Regards,
> >> > Jitesh
> >>
> >> _______________________________________________
> >> aspectj-users mailing list
> >>
aspectj-users@xxxxxxxxxxx
> >> https://dev.eclipse.org/mailman/listinfo/aspectj-users
> >>
> >>
> >>
> >
> >
> > --
> > -- Adrian
> >
adrian.colyer@xxxxxxxxx
> > -------------- next part --------------
> > An HTML attachment was scrubbed...
> > URL:
> >
>
http://eclipse.org/pipermail/aspectj-users/attachments/20060516/3925cfe1/attachment.html
> >
> > ------------------------------
> >
> > _______________________________________________
> > aspectj-users mailing list
> >
aspectj-users@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/aspectj-users
> >
> >
> > End of aspectj-users Digest, Vol 15, Issue 29
> > *********************************************
>
> _______________________________________________
> aspectj-users mailing list
>
aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>



--
-- Adrian
adrian.colyer@xxxxxxxxx
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://eclipse.org/pipermail/aspectj-users/attachments/20060519/42b2fc18/attachment.html

------------------------------

Back to the top