Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Re: aspectj-users Digest, Vol 54, Issue 24

The LTW problem in tomcat was indeed a classloader problem. When I located the aspects in the tomcat lib the problem was solved
Thanks Andy,

Yaron

On Sat, Aug 22, 2009 at 2:54 PM, <aspectj-users-request@xxxxxxxxxxx> wrote:
Send aspectj-users mailing list submissions to
       aspectj-users@xxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
       https://dev.eclipse.org/mailman/listinfo/aspectj-users
or, via email, send a message with subject or body 'help' to
       aspectj-users-request@xxxxxxxxxxx

You can reach the person managing the list at
       aspectj-users-owner@xxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of aspectj-users digest..."


Today's Topics:

  1. Re: Problem with load-time weaving (Andy Clement)
  2. Re: LTW Problem with Tomcat 6 (Andy Clement)
  3. Generic aspect inter-type declaration - possible or
     limitation of aspectj? (Andreas Holst)
  4. Re: Intertype declaration ,       parameterized generic HashSet
     does not work (Andreas M?ller Holst)


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

Message: 1
Date: Fri, 21 Aug 2009 09:12:17 -0700
From: Andy Clement <andrew.clement@xxxxxxxxx>
Subject: Re: [aspectj-users] Problem with load-time weaving
To: aspectj-users@xxxxxxxxxxx
Message-ID:
       <689d61aa0908210912i4ef6b3dbgbead81dab31e3828@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="iso-8859-1"

Hi Nikolas,

When setting up a project dependency like that.  If you have an inpath
dependency then code on that path will be woven and put into the output
directory of the project expressing the dependency.  If you have an
aspectpath dependency then that is merely acting as a place to source
aspects from, the code on that path is not woven and copied to the output
directory of the project expressing the dependency.  Maybe that description
will help you understand what is wrong?

On your specific description:

> If  I add my testapp project to the inpath (of the debugger project),
weaving doesn't work.

That should work.  The debugger aspect will weave into the code coming in
from the classpath *and put the woven code in the output folder of the
DEBUGGER project*.  Maybe this latter clause is describing the problem - the
woven code is now in the debugger project, it is not in the testapp project.

> If I add the debugger project to the aspectpath of testapp, the weaving
works.

Here the debugger aspect is applied to the code in testapp, and the woven
code is in the output folder of the testapp project.

So the difference is that if using the inpath, you need to 'run' the
debugger project as that is where the woven application will be.

cheers,
Andy

2009/8/21 Nikolas Nehmer <nnehmer@xxxxxxxxxxxxxxxxxxxx>

> Hi,
>
> the main problem seems to be the inpath setting. If  I add my testapp
> project to the inpath (of the debugger project), weaving doesn't work. If I
> add the debugger project to the aspectpath of testapp, the weaving works.
> Shouldn't it work in both ways? Any suggestions?
>
> Best Nikolas
>
> Nikolas Nehmer schrieb:
>
>  Hi,
>>
>> recently I changed my complete setting and you're right, currently no
>> aspects are woven at all during runtime. I'm using ajdt in eclispe buildind
>> a load-time weaving configuration. Obviously it doesn't work :-( Of course,
>> there is an aop-ajc.xml file present that includes the aspect I'm trying to
>> weave. The small example illustrated on the AJDT demo page works perfectly.
>> Currently I have no clue why the weaver doesn't work in my setting.
>>
>> Just to give you an impression, a short description of my setup. I'm
>> building a debugger application startin a test application in a debug vm -
>> both sperated in 2 Eclipse projects. Basically, the test app running in
>> debugging mode should be aspectized (maybe this is the source of the problem
>> as they are running in 2 different vms?). The aspect itself is part of the
>> debugger project.
>>
>> Any suggestions?
>>
>> Best Nikolas
>>
>> Andrew Eisenberg schrieb:
>>
>>> A few questions:
>>>
>>> 1. Have you created a correct aop,xml and is it being used at runtime?
>>> 2. Is this aspect included in your aop.xml?
>>> 3. Are you running with the correct java agent?
>>> 4. Are any aspects being woven at runtime, or are you having a problem
>>> just with this aspect?
>>>
>>> Maybe answering these questions will help solve your problem.
>>>
>>> --a
>>>
>>> On Wed, Aug 19, 2009 at 9:08 AM, Nikolas
>>> Nehmer<nnehmer@xxxxxxxxxxxxxxxxxxxx> wrote:
>>>
>>>
>>>> Hi there,
>>>>
>>>> currently I have a problem with AJDT's load-time weaving capability.
>>>> Unforntunately the following pointcut is not applied:
>>>>
>>>>  pointcut mainMethodCall() : execution(static void main(String [])) &&
>>>> !within(TestAspect) && !within(setup..*);
>>>>
>>>> For compile-time weaving the same aspect works out. Any ideas?
>>>>
>>>> Best Nikolas
>>>> _______________________________________________
>>>> 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
>>>
>>>
>>
>>
>>
>
> --
> Dipl.-Inf. Nikolas Nehmer,
> Dept. of Computer Science. University of Kaiserslautern P.O. Box 3049,
> 67653 Kaiserslautern, Germany.
> room 36/308, phone: +49 (0) 631 - 205 2644, fax: +49 (0) 631 - 205 3299
> mail: nnehmer@xxxxxxxxxxxxxxxxxxxx
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://dev.eclipse.org/mailman/private/aspectj-users/attachments/20090821/7e449b69/attachment.html

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

Message: 2
Date: Fri, 21 Aug 2009 14:32:34 -0700
From: Andy Clement <andrew.clement@xxxxxxxxx>
Subject: Re: [aspectj-users] LTW Problem with Tomcat 6
To: aspectj-users@xxxxxxxxxxx
Message-ID:
       <689d61aa0908211432h1f3d8993r859923c7e153ef51@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="iso-8859-1"

Hey,

I'm surprised you haven't had a reply on this as I know users do have this
kind of configuration running.

I'd be expecting the ServletException to be loaded by a classloader higher
up the hierarchy than that used to load and run the application.  I presume
you are just weaving the application and nothing unusual like javax.* types?

Andy

2009/8/19 yaron <yaronp68@xxxxxxxxx>

> Hi,
>
> I posted a note yesterday about LTW with Tomcat
>
> The problem only happens with JSPs that are not precompiled
>
> ava.lang.ClassNotFoundException: javax.servlet.ServletException
>     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
>     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:212)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>
> maybe this information can shed more light about the class loader problem
> thanks
> Yaron
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://dev.eclipse.org/mailman/private/aspectj-users/attachments/20090821/131b181f/attachment.html

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

Message: 3
Date: Sat, 22 Aug 2009 03:10:29 +0200
From: Andreas Holst <aspectj.andreas@xxxxxxxxx>
Subject: [aspectj-users] Generic aspect inter-type declaration -
       possible or     limitation of aspectj?
To: aspectj-users@xxxxxxxxxxx
Message-ID:
       <ee2d2b110908211810h721cfc70w1591568949591b64@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset=ISO-8859-1

Hi everybody (...hi doctor Nick :)

Im trying to make an aspect which will introduce some members into a class.

I have the classes Person and Course.
public

class Course {}
public class Person {}

My idea is to introduce a HashSet of type Person into the class Course.
I can succesfully achieve this with the following aspect:

public aspect BoundAspect {
  public HashSet<Person> Course.genericHash = new HashSet<Person>();
  public void Course.newMethod(Person per)
 {genericHash.add(per);}
}

Now. I want to make this a tiny bit more general. Instead of only
being able to introduce a HashSet of type Person as well as a method
that works on type Person, I want a solution that can be
parameterized. I have tried the follwoing - notice that the aspect
must now be abstract, hence I have added the aspect ConcreteAspect
which extends AbstractGenericAspect

public abstract aspect AbstracGenericAspect<TO> {
  public HashSet<TO> Course.genericHash = new HashSet<TO>();
  public void Course.newMethod(TO to)
  {genericHash.add(to);}   // here I receive the error: The method
add(TO) in the type HashSet<TO> is not applicable for the arguments
(TO)
public

aspect ConcreteAspect extends AbstracGenericAspect<Person> {}
!! Notice the error: /The method add(TO) in the type HashSet<TO> is
not applicable for the arguments (TO)/. This does not make sense to
me. Am I doing something wrong or is this a limitation of AspectJ?

Have a nice weekend / Andreas


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

Message: 4
Date: Sat, 22 Aug 2009 13:53:41 +0200
From: Andreas M?ller Holst <andreasholst@xxxxxxxxx>
Subject: Re: [aspectj-users] Intertype declaration ,    parameterized
       generic HashSet does not work
To: "aspectj-users@xxxxxxxxxxx" <aspectj-users@xxxxxxxxxxx>
Message-ID: <B78B768A-2307-43AD-B0A3-69173DB10B69@xxxxxxxxx>
Content-Type: text/plain; charset="utf-8"

Hi Andy

Thank you for your reply. I have simplified and reprashed the
question, hoping for an answer. If not i'll register a bug.

Thanks / Andreas



On 11/08/2009, at 23.17, Andy Clement <andrew.clement@xxxxxxxxx> wrote:

> Hi,
>
> seems like a generics aspects bug, although maybe a limitation.
> That is a pretty sophisticated aspect and I'd need to spend some
> time with pen and paper working out if what you are trying to do is
> (a) possible (b) supported.  I would raise an AspectJ bug for
> clarification of this.
>
> Andy
>
> 2009/8/9 Andreas Møller Holst <andreasholst@xxxxxxxxx>
> Hi
>
> Im new to AOP and AspectJ. Currently Im studying an aspect oriented
> library to support associations as cross cutting concerns.
>
> In this library I have an aspect /SimpleStaticRel/ that alters the
> type hirarchy and introduce new members to the formal type
> parameters /FROM/ and /TO/.
> Below I present a snippet of the original implementation which is
> relevant to my question.
>
> #1:
>
> If I declare /final private HashSet<TO> Fwd.fwd = new HashSet<TO>
> ();/ I get the follwoing compile error: The method add(TO) in the
> type HashSet<TO> is not applicable for the arguments (TO)
> forward.fwd.add(_t);
> #2:
>
> Here I have made a test which shows me that its possible to
> parameterize a HashSet with generic type /FROM/. This HashSet is a
> member of the aspect and is not introduced as a member of FROM.
> Why is it ok to parameterize in this situation?
>
> -----------------------------  -----------------------------
> ----------------------------- -----------------------------
> -----------------------------
>
> import java.util.*;
>
> public abstract aspect SimpleStaticRel <FROM,TO>{
>
> public static interface Fwd {}
>
> //public static interface Bwd {}
>
> declare parents : FROM implements Fwd;
>
> // #1
> final private HashSet<TO> Fwd.fwd = new HashSet<TO>();
> //final private HashSet Fwd.fwd = new HashSet();
>
> // #2
> private HashSet<TO> myHash = new HashSet<TO>();
>
> public boolean add(FROM _f, TO _t) {
>    myHash.add(_t);
>    return true;
> }
>
> public boolean andreasAdd(FROM _f, TO _t) {
>    Fwd forward = (Fwd) _f;
>    forward.fwd.add(_t);
>
>    return true;
> }
>
> }
>
> Thank you / dres
>
>
>
> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://dev.eclipse.org/mailman/private/aspectj-users/attachments/20090822/0af79b16/attachment.html

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

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


End of aspectj-users Digest, Vol 54, Issue 24
*********************************************


Back to the top