Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » How to add aspects to multiple eclipse plugin projects?
How to add aspects to multiple eclipse plugin projects? [message #35582] Mon, 10 May 2004 21:26 Go to next message
Eclipse User
Originally posted by: Michael-Scharf.gmx.de

Hi,

I want to "aspectize" multiple projects with AJDT/aspectj.

Suppose, I want to add a simple tracing aspect to all
public methods that are called "run".

public aspect TraceRun {
pointcut run(): execution(public * *.run(..));
before() : run() {
System.out.println("TRACE "+thisJoinPoint);
}
}

I want to add this aspect to the entire workbench or
at a set of projects. Ideally I would like to have
independent plugins/projects with aspects and "inject"
the code into my unmodified eclipse plugins. Is this
possible?

Here some concrete questions:

- Is aspectj supported for eclipse plugins or only for
stand alone applications?

- How to best add aspects to a a set of plugin projects?
- Can aspects cross project/plugin boundaries?
- Is there a better way than to copy the aspect into
each project?
<library name=" c:/eclipse/3.0M8/eclipse/plugins/org.aspectj.ajde_1.1.8/aspe ctjrt.jar ">
<export name="*"/>
</library>

- How to add the aspectjrt.jar to the projects?
- It is not clear to me where to put the lib for
plugin projects. I ended up adding the absolute
path "Runtime Library" into each plugin.xml

- How can I control adding the aspect (changes in the
.lst file seems to have no effect on plugins)

- Can I add the aspect without modifying existing projects?

Thanks for listening

Michael
Re: How to add aspects to multiple eclipse plugin projects? [message #35820 is a reply to message #35582] Wed, 19 May 2004 00:53 Go to previous messageGo to next message
Corville Allen is currently offline Corville Allen
Messages: 2
Registered: July 2009
Junior Member
I am also interested in a solution for this.

I would like to use a separate project for my aspects, and having the
aspects dynamically link to other projects that marks it as dependent.

"Michael Scharf" <Michael-Scharf@gmx.de> wrote in message
news:c7p9ob$3s3$1@eclipse.org...
> Hi,
>
> I want to "aspectize" multiple projects with AJDT/aspectj.
>
> Suppose, I want to add a simple tracing aspect to all
> public methods that are called "run".
>
> public aspect TraceRun {
> pointcut run(): execution(public * *.run(..));
> before() : run() {
> System.out.println("TRACE "+thisJoinPoint);
> }
> }
>
> I want to add this aspect to the entire workbench or
> at a set of projects. Ideally I would like to have
> independent plugins/projects with aspects and "inject"
> the code into my unmodified eclipse plugins. Is this
> possible?
>
> Here some concrete questions:
>
> - Is aspectj supported for eclipse plugins or only for
> stand alone applications?
>
> - How to best add aspects to a a set of plugin projects?
> - Can aspects cross project/plugin boundaries?
> - Is there a better way than to copy the aspect into
> each project?
> <library
name=" c:/eclipse/3.0M8/eclipse/plugins/org.aspectj.ajde_1.1.8/aspe ctjrt.jar "
>
> <export name="*"/>
> </library>
>
> - How to add the aspectjrt.jar to the projects?
> - It is not clear to me where to put the lib for
> plugin projects. I ended up adding the absolute
> path "Runtime Library" into each plugin.xml
>
> - How can I control adding the aspect (changes in the
> .lst file seems to have no effect on plugins)
>
> - Can I add the aspect without modifying existing projects?
>
> Thanks for listening
>
> Michael
Re: How to add aspects to multiple eclipse plugin projects? [message #38259 is a reply to message #35820] Wed, 14 July 2004 09:28 Go to previous messageGo to next message
Dennis Fuglsang is currently offline Dennis Fuglsang
Messages: 77
Registered: July 2009
Member
Corville or Michael,

I am hoping that one of you can provide me with some guidance since it does
not appear that I am getting responses from my other postings. What I am
simply trying to do is develope a eclipse plugin project that adds some
debugging/tracing support to one or more of the org.eclipse.emf projects (or
any other org.eclipse plugin). The plugin containing my aspects depends
upon those org.eclipse projects. It compiles successfully and appears to
correctly modify the appropriate class files (I also see the aspect class
file within the output jar). I encounter problems when I try running my
application in the Eclipse runtime environment. When the pointcut is
encountered in the org.eclipse
code I get a java.lang.NoClassDefFoundError exception listing my aspect
class.

Do the aspects and the code containing the join points need to be in the
same Eclipse project? That would seem to severly limit the power of
cross-cutting multiple projects. How do Eclipse project dependencies and
project classloaders work with aspects and AJDT?

Any help you can provide would be greatly appreciated. Thanks

Dennis Fuglsang



"Corville Allen" <corville@us.ibm.com> wrote in message
news:c8eorl$9d4$1@eclipse.org...
> I am also interested in a solution for this.
>
> I would like to use a separate project for my aspects, and having the
> aspects dynamically link to other projects that marks it as dependent.
>
> "Michael Scharf" <Michael-Scharf@gmx.de> wrote in message
> news:c7p9ob$3s3$1@eclipse.org...
> > Hi,
> >
> > I want to "aspectize" multiple projects with AJDT/aspectj.
> >
> > Suppose, I want to add a simple tracing aspect to all
> > public methods that are called "run".
> >
> > public aspect TraceRun {
> > pointcut run(): execution(public * *.run(..));
> > before() : run() {
> > System.out.println("TRACE "+thisJoinPoint);
> > }
> > }
> >
> > I want to add this aspect to the entire workbench or
> > at a set of projects. Ideally I would like to have
> > independent plugins/projects with aspects and "inject"
> > the code into my unmodified eclipse plugins. Is this
> > possible?
> >
> > Here some concrete questions:
> >
> > - Is aspectj supported for eclipse plugins or only for
> > stand alone applications?
> >
> > - How to best add aspects to a a set of plugin projects?
> > - Can aspects cross project/plugin boundaries?
> > - Is there a better way than to copy the aspect into
> > each project?
> > <library
>
name=" c:/eclipse/3.0M8/eclipse/plugins/org.aspectj.ajde_1.1.8/aspe ctjrt.jar "
> >
> > <export name="*"/>
> > </library>
> >
> > - How to add the aspectjrt.jar to the projects?
> > - It is not clear to me where to put the lib for
> > plugin projects. I ended up adding the absolute
> > path "Runtime Library" into each plugin.xml
> >
> > - How can I control adding the aspect (changes in the
> > .lst file seems to have no effect on plugins)
> >
> > - Can I add the aspect without modifying existing projects?
> >
> > Thanks for listening
> >
> > Michael
>
>
Re: How to add aspects to multiple eclipse plugin projects? [message #38292 is a reply to message #38259] Wed, 14 July 2004 16:57 Go to previous messageGo to next message
Eclipse User
Originally posted by: george_harley.ntlworld.com

Hi Dennis,

Does your plug-in have a dependency on the org.aspectj.ajde plug-in ? If
not, how are you adding the necessary aspectjrt.jar to your plug-in's
runtime classpath ?

Best regards,
George

Dennis Fuglsang wrote:
> Corville or Michael,
>
> I am hoping that one of you can provide me with some guidance since it does
> not appear that I am getting responses from my other postings. What I am
> simply trying to do is develope a eclipse plugin project that adds some
> debugging/tracing support to one or more of the org.eclipse.emf projects (or
> any other org.eclipse plugin). The plugin containing my aspects depends
> upon those org.eclipse projects. It compiles successfully and appears to
> correctly modify the appropriate class files (I also see the aspect class
> file within the output jar). I encounter problems when I try running my
> application in the Eclipse runtime environment. When the pointcut is
> encountered in the org.eclipse
> code I get a java.lang.NoClassDefFoundError exception listing my aspect
> class.
>
> Do the aspects and the code containing the join points need to be in the
> same Eclipse project? That would seem to severly limit the power of
> cross-cutting multiple projects. How do Eclipse project dependencies and
> project classloaders work with aspects and AJDT?
>
> Any help you can provide would be greatly appreciated. Thanks
>
> Dennis Fuglsang
>
>
>
> "Corville Allen" <corville@us.ibm.com> wrote in message
> news:c8eorl$9d4$1@eclipse.org...
>
>>I am also interested in a solution for this.
>>
>>I would like to use a separate project for my aspects, and having the
>>aspects dynamically link to other projects that marks it as dependent.
>>
>>"Michael Scharf" <Michael-Scharf@gmx.de> wrote in message
>>news:c7p9ob$3s3$1@eclipse.org...
>>
>>>Hi,
>>>
>>>I want to "aspectize" multiple projects with AJDT/aspectj.
>>>
>>>Suppose, I want to add a simple tracing aspect to all
>>>public methods that are called "run".
>>>
>>> public aspect TraceRun {
>>>pointcut run(): execution(public * *.run(..));
>>>before() : run() {
>>>System.out.println("TRACE "+thisJoinPoint);
>>>}
>>> }
>>>
>>>I want to add this aspect to the entire workbench or
>>>at a set of projects. Ideally I would like to have
>>>independent plugins/projects with aspects and "inject"
>>>the code into my unmodified eclipse plugins. Is this
>>>possible?
>>>
>>>Here some concrete questions:
>>>
>>>- Is aspectj supported for eclipse plugins or only for
>>> stand alone applications?
>>>
>>>- How to best add aspects to a a set of plugin projects?
>>> - Can aspects cross project/plugin boundaries?
>>> - Is there a better way than to copy the aspect into
>>> each project?
>>> <library
>>
> name=" c:/eclipse/3.0M8/eclipse/plugins/org.aspectj.ajde_1.1.8/aspe ctjrt.jar "
>
>>> <export name="*"/>
>>> </library>
>>>
>>>- How to add the aspectjrt.jar to the projects?
>>> - It is not clear to me where to put the lib for
>>> plugin projects. I ended up adding the absolute
>>> path "Runtime Library" into each plugin.xml
>>>
>>>- How can I control adding the aspect (changes in the
>>> .lst file seems to have no effect on plugins)
>>>
>>>- Can I add the aspect without modifying existing projects?
>>>
>>>Thanks for listening
>>>
>>>Michael
>>
>>
>
>
Re: How to add aspects to multiple eclipse plugin projects? [message #38358 is a reply to message #38292] Thu, 15 July 2004 10:06 Go to previous messageGo to next message
Dennis Fuglsang is currently offline Dennis Fuglsang
Messages: 77
Registered: July 2009
Member
Thank you for your reply George,

The plugin project containing the aspects, call it "dev", is an AspectJ
project so that build path has a reference to the aspectjrt.jar. The
project I am trying to pointcut, org.eclipse.emf.ecore, I have added
org.aspectj.ajde as a project dependency. Still when I launch my
application, contained in a plugin project called "test", I encounter a
java.lang.NoClassDefFoundError exception when the pointcut is encountered in
the org.eclipse.emf.ecore plugin. Do I only need aspectjrt.jar in the
runtime classpath of the plugins that were modified? Any suggestions?

Thanks in advance,

Dennis Fuglsang

"George Harley" <george_harley@ntlworld.com> wrote in message
news:cd46ll$cnk$1@eclipse.org...
> Hi Dennis,
>
> Does your plug-in have a dependency on the org.aspectj.ajde plug-in ? If
> not, how are you adding the necessary aspectjrt.jar to your plug-in's
> runtime classpath ?
>
> Best regards,
> George
>
> Dennis Fuglsang wrote:
> > Corville or Michael,
> >
> > I am hoping that one of you can provide me with some guidance since it
does
> > not appear that I am getting responses from my other postings. What I
am
> > simply trying to do is develope a eclipse plugin project that adds some
> > debugging/tracing support to one or more of the org.eclipse.emf projects
(or
> > any other org.eclipse plugin). The plugin containing my aspects depends
> > upon those org.eclipse projects. It compiles successfully and appears
to
> > correctly modify the appropriate class files (I also see the aspect
class
> > file within the output jar). I encounter problems when I try running
my
> > application in the Eclipse runtime environment. When the pointcut is
> > encountered in the org.eclipse
> > code I get a java.lang.NoClassDefFoundError exception listing my aspect
> > class.
> >
> > Do the aspects and the code containing the join points need to be in the
> > same Eclipse project? That would seem to severly limit the power of
> > cross-cutting multiple projects. How do Eclipse project dependencies
and
> > project classloaders work with aspects and AJDT?
> >
> > Any help you can provide would be greatly appreciated. Thanks
> >
> > Dennis Fuglsang
> >
> >
> >
> > "Corville Allen" <corville@us.ibm.com> wrote in message
> > news:c8eorl$9d4$1@eclipse.org...
> >
> >>I am also interested in a solution for this.
> >>
> >>I would like to use a separate project for my aspects, and having the
> >>aspects dynamically link to other projects that marks it as dependent.
> >>
> >>"Michael Scharf" <Michael-Scharf@gmx.de> wrote in message
> >>news:c7p9ob$3s3$1@eclipse.org...
> >>
> >>>Hi,
> >>>
> >>>I want to "aspectize" multiple projects with AJDT/aspectj.
> >>>
> >>>Suppose, I want to add a simple tracing aspect to all
> >>>public methods that are called "run".
> >>>
> >>> public aspect TraceRun {
> >>>pointcut run(): execution(public * *.run(..));
> >>>before() : run() {
> >>>System.out.println("TRACE "+thisJoinPoint);
> >>>}
> >>> }
> >>>
> >>>I want to add this aspect to the entire workbench or
> >>>at a set of projects. Ideally I would like to have
> >>>independent plugins/projects with aspects and "inject"
> >>>the code into my unmodified eclipse plugins. Is this
> >>>possible?
> >>>
> >>>Here some concrete questions:
> >>>
> >>>- Is aspectj supported for eclipse plugins or only for
> >>> stand alone applications?
> >>>
> >>>- How to best add aspects to a a set of plugin projects?
> >>> - Can aspects cross project/plugin boundaries?
> >>> - Is there a better way than to copy the aspect into
> >>> each project?
> >>> <library
> >>
> >
name=" c:/eclipse/3.0M8/eclipse/plugins/org.aspectj.ajde_1.1.8/aspe ctjrt.jar "
> >
> >>> <export name="*"/>
> >>> </library>
> >>>
> >>>- How to add the aspectjrt.jar to the projects?
> >>> - It is not clear to me where to put the lib for
> >>> plugin projects. I ended up adding the absolute
> >>> path "Runtime Library" into each plugin.xml
> >>>
> >>>- How can I control adding the aspect (changes in the
> >>> .lst file seems to have no effect on plugins)
> >>>
> >>>- Can I add the aspect without modifying existing projects?
> >>>
> >>>Thanks for listening
> >>>
> >>>Michael
> >>
> >>
> >
> >
Re: How to add aspects to multiple eclipse plugin projects? [message #38525 is a reply to message #38358] Thu, 15 July 2004 19:46 Go to previous messageGo to next message
Eclipse User
Originally posted by: george_harley.ntlworld.com

Hi Dennis,

So, if I understand correctly, your setup is as follows...

1. Plug-in project called "dev". Has AspectJ nature, contains aspects.
2. Plug-in project org.eclipse.emf.core. Does this have an AspectJ
nature ? Does it contain any aspect code ? Have you woven in your
aspects (from "dev") ? Did you carry out binary weaving against any jars
in this project or are you building against its source ?
3. Plug-in project called "test". Does this have an AspectJ nature ? Is
it just ordinary Java calling into your org.eclipse.emf.core plug-in ?

Assuming the above summary is correct (?), how have you configured the
dependencies between these different plug-ins ? Where are your compiled
aspects at runtime and where are the classes that you have woven into ?

I would really like to help you out here but until I get a better
understanding of the topography of your workbench then I am of limited
use (even more than usual!). If you want to mail me off-group with more
details on your projects then I will see what I can do. What you are
trying to do *should* be possible...

Best regards,
George


Dennis Fuglsang wrote:
> Thank you for your reply George,
>
> The plugin project containing the aspects, call it "dev", is an AspectJ
> project so that build path has a reference to the aspectjrt.jar. The
> project I am trying to pointcut, org.eclipse.emf.ecore, I have added
> org.aspectj.ajde as a project dependency. Still when I launch my
> application, contained in a plugin project called "test", I encounter a
> java.lang.NoClassDefFoundError exception when the pointcut is encountered in
> the org.eclipse.emf.ecore plugin. Do I only need aspectjrt.jar in the
> runtime classpath of the plugins that were modified? Any suggestions?
>
> Thanks in advance,
>
> Dennis Fuglsang
>
> "George Harley" <george_harley@ntlworld.com> wrote in message
> news:cd46ll$cnk$1@eclipse.org...
>
>>Hi Dennis,
>>
>>Does your plug-in have a dependency on the org.aspectj.ajde plug-in ? If
>>not, how are you adding the necessary aspectjrt.jar to your plug-in's
>>runtime classpath ?
>>
>>Best regards,
>>George
>>
>>Dennis Fuglsang wrote:
>>
>>>Corville or Michael,
>>>
>>>I am hoping that one of you can provide me with some guidance since it
>
> does
>
>>>not appear that I am getting responses from my other postings. What I
>
> am
>
>>>simply trying to do is develope a eclipse plugin project that adds some
>>>debugging/tracing support to one or more of the org.eclipse.emf projects
>
> (or
>
>>>any other org.eclipse plugin). The plugin containing my aspects depends
>>>upon those org.eclipse projects. It compiles successfully and appears
>
> to
>
>>>correctly modify the appropriate class files (I also see the aspect
>
> class
>
>>>file within the output jar). I encounter problems when I try running
>
> my
>
>>>application in the Eclipse runtime environment. When the pointcut is
>>>encountered in the org.eclipse
>>>code I get a java.lang.NoClassDefFoundError exception listing my aspect
>>>class.
>>>
>>>Do the aspects and the code containing the join points need to be in the
>>>same Eclipse project? That would seem to severly limit the power of
>>>cross-cutting multiple projects. How do Eclipse project dependencies
>
> and
>
>>>project classloaders work with aspects and AJDT?
>>>
>>>Any help you can provide would be greatly appreciated. Thanks
>>>
>>>Dennis Fuglsang
>>>
>>>
>>>
>>>"Corville Allen" <corville@us.ibm.com> wrote in message
>>>news:c8eorl$9d4$1@eclipse.org...
>>>
>>>
>>>>I am also interested in a solution for this.
>>>>
>>>>I would like to use a separate project for my aspects, and having the
>>>>aspects dynamically link to other projects that marks it as dependent.
>>>>
>>>>"Michael Scharf" <Michael-Scharf@gmx.de> wrote in message
>>>>news:c7p9ob$3s3$1@eclipse.org...
>>>>
>>>>
>>>>>Hi,
>>>>>
>>>>>I want to "aspectize" multiple projects with AJDT/aspectj.
>>>>>
>>>>>Suppose, I want to add a simple tracing aspect to all
>>>>>public methods that are called "run".
>>>>>
>>>>> public aspect TraceRun {
>>>>>pointcut run(): execution(public * *.run(..));
>>>>>before() : run() {
>>>>>System.out.println("TRACE "+thisJoinPoint);
>>>>>}
>>>>> }
>>>>>
>>>>>I want to add this aspect to the entire workbench or
>>>>>at a set of projects. Ideally I would like to have
>>>>>independent plugins/projects with aspects and "inject"
>>>>>the code into my unmodified eclipse plugins. Is this
>>>>>possible?
>>>>>
>>>>>Here some concrete questions:
>>>>>
>>>>>- Is aspectj supported for eclipse plugins or only for
>>>>> stand alone applications?
>>>>>
>>>>>- How to best add aspects to a a set of plugin projects?
>>>>> - Can aspects cross project/plugin boundaries?
>>>>> - Is there a better way than to copy the aspect into
>>>>> each project?
>>>>> <library
>>>>
> name=" c:/eclipse/3.0M8/eclipse/plugins/org.aspectj.ajde_1.1.8/aspe ctjrt.jar "
>
>>>>> <export name="*"/>
>>>>> </library>
>>>>>
>>>>>- How to add the aspectjrt.jar to the projects?
>>>>> - It is not clear to me where to put the lib for
>>>>> plugin projects. I ended up adding the absolute
>>>>> path "Runtime Library" into each plugin.xml
>>>>>
>>>>>- How can I control adding the aspect (changes in the
>>>>> .lst file seems to have no effect on plugins)
>>>>>
>>>>>- Can I add the aspect without modifying existing projects?
>>>>>
>>>>>Thanks for listening
>>>>>
>>>>>Michael
>>>>
>>>>
>>>
>
>
Re: How to add aspects to multiple eclipse plugin projects? [message #39100 is a reply to message #38525] Thu, 22 July 2004 15:59 Go to previous message
Dennis Fuglsang is currently offline Dennis Fuglsang
Messages: 77
Registered: July 2009
Member
George,

Thank you for your responses and your offer to work with me offline. I have
solved my mysterious NoClassDefFoundError. The plugin.xml for the project
we were "aspectizing" contained a package prefix declaration that defines
the list of package prefixes for the runtime library. The problem was that
the list of package prefixes did not include the package for the aspect I
was weaving into the project. In other words, even though my output jar
from the AspectJ compiler included my aspect class the classloader for that
plugin could not find it because it was not in the "org.eclipse.emf.core*"
package. I had looked at the plugin.xml numerous times but for some reason
I was discounted the <packages prefixes> as a problem.
<requires>
<import plugin="org.apache.xerces"/>
<import plugin="org.eclipse.core.resources"/>
<import plugin="org.eclipse.emf.common" export="true"/>
<import plugin="org.aspectj.ajde"/>
</requires>

<runtime>
<library name="runtime/ecore_AOP.jar">
<export name="*"/>
</library>
<library name="runtime/ecore.jar">
<export name="*"/>
<packages prefixes="org.eclipse.emf.ecore"/> <<<<<<============ this
was my problem
</library>
</runtime>


Once I removed the package prefix list in my plugin.xml the aspects started
working. Yaaaahoooo!

--Dennis Fuglsang

"George Harley" <george_harley@ntlworld.com> wrote in message
news:cd74tl$49m$1@eclipse.org...
> Hi Dennis,
>
> So, if I understand correctly, your setup is as follows...
>
> 1. Plug-in project called "dev". Has AspectJ nature, contains aspects.
> 2. Plug-in project org.eclipse.emf.core. Does this have an AspectJ
> nature ? Does it contain any aspect code ? Have you woven in your
> aspects (from "dev") ? Did you carry out binary weaving against any jars
> in this project or are you building against its source ?
> 3. Plug-in project called "test". Does this have an AspectJ nature ? Is
> it just ordinary Java calling into your org.eclipse.emf.core plug-in ?
>
> Assuming the above summary is correct (?), how have you configured the
> dependencies between these different plug-ins ? Where are your compiled
> aspects at runtime and where are the classes that you have woven into ?
>
> I would really like to help you out here but until I get a better
> understanding of the topography of your workbench then I am of limited
> use (even more than usual!). If you want to mail me off-group with more
> details on your projects then I will see what I can do. What you are
> trying to do *should* be possible...
>
> Best regards,
> George
>
>
> Dennis Fuglsang wrote:
> > Thank you for your reply George,
> >
> > The plugin project containing the aspects, call it "dev", is an AspectJ
> > project so that build path has a reference to the aspectjrt.jar. The
> > project I am trying to pointcut, org.eclipse.emf.ecore, I have added
> > org.aspectj.ajde as a project dependency. Still when I launch my
> > application, contained in a plugin project called "test", I encounter a
> > java.lang.NoClassDefFoundError exception when the pointcut is
encountered in
> > the org.eclipse.emf.ecore plugin. Do I only need aspectjrt.jar in the
> > runtime classpath of the plugins that were modified? Any suggestions?
> >
> > Thanks in advance,
> >
> > Dennis Fuglsang
> >
> > "George Harley" <george_harley@ntlworld.com> wrote in message
> > news:cd46ll$cnk$1@eclipse.org...
> >
> >>Hi Dennis,
> >>
> >>Does your plug-in have a dependency on the org.aspectj.ajde plug-in ? If
> >>not, how are you adding the necessary aspectjrt.jar to your plug-in's
> >>runtime classpath ?
> >>
> >>Best regards,
> >>George
> >>
> >>Dennis Fuglsang wrote:
> >>
> >>>Corville or Michael,
> >>>
> >>>I am hoping that one of you can provide me with some guidance since it
> >
> > does
> >
> >>>not appear that I am getting responses from my other postings. What I
> >
> > am
> >
> >>>simply trying to do is develope a eclipse plugin project that adds some

> >>>debugging/tracing support to one or more of the org.eclipse.emf
projects
> >
> > (or
> >
> >>>any other org.eclipse plugin). The plugin containing my aspects
depends
> >>>upon those org.eclipse projects. It compiles successfully and appears
> >
> > to
> >
> >>>correctly modify the appropriate class files (I also see the aspect
> >
> > class
> >
> >>>file within the output jar). I encounter problems when I try running
> >
> > my
> >
> >>>application in the Eclipse runtime environment. When the pointcut is
> >>>encountered in the org.eclipse
> >>>code I get a java.lang.NoClassDefFoundError exception listing my aspect
> >>>class.
> >>>
> >>>Do the aspects and the code containing the join points need to be in
the
> >>>same Eclipse project? That would seem to severly limit the power of
> >>>cross-cutting multiple projects. How do Eclipse project dependencies
> >
> > and
> >
> >>>project classloaders work with aspects and AJDT?
> >>>
> >>>Any help you can provide would be greatly appreciated. Thanks
> >>>
> >>>Dennis Fuglsang
> >>>
> >>>
> >>>
> >>>"Corville Allen" <corville@us.ibm.com> wrote in message
> >>>news:c8eorl$9d4$1@eclipse.org...
> >>>
> >>>
> >>>>I am also interested in a solution for this.
> >>>>
> >>>>I would like to use a separate project for my aspects, and having the
> >>>>aspects dynamically link to other projects that marks it as dependent.
> >>>>
> >>>>"Michael Scharf" <Michael-Scharf@gmx.de> wrote in message
> >>>>news:c7p9ob$3s3$1@eclipse.org...
> >>>>
> >>>>
> >>>>>Hi,
> >>>>>
> >>>>>I want to "aspectize" multiple projects with AJDT/aspectj.
> >>>>>
> >>>>>Suppose, I want to add a simple tracing aspect to all
> >>>>>public methods that are called "run".
> >>>>>
> >>>>> public aspect TraceRun {
> >>>>>pointcut run(): execution(public * *.run(..));
> >>>>>before() : run() {
> >>>>>System.out.println("TRACE "+thisJoinPoint);
> >>>>>}
> >>>>> }
> >>>>>
> >>>>>I want to add this aspect to the entire workbench or
> >>>>>at a set of projects. Ideally I would like to have
> >>>>>independent plugins/projects with aspects and "inject"
> >>>>>the code into my unmodified eclipse plugins. Is this
> >>>>>possible?
> >>>>>
> >>>>>Here some concrete questions:
> >>>>>
> >>>>>- Is aspectj supported for eclipse plugins or only for
> >>>>> stand alone applications?
> >>>>>
> >>>>>- How to best add aspects to a a set of plugin projects?
> >>>>> - Can aspects cross project/plugin boundaries?
> >>>>> - Is there a better way than to copy the aspect into
> >>>>> each project?
> >>>>> <library
> >>>>
> >
name=" c:/eclipse/3.0M8/eclipse/plugins/org.aspectj.ajde_1.1.8/aspe ctjrt.jar "
> >
> >>>>> <export name="*"/>
> >>>>> </library>
> >>>>>
> >>>>>- How to add the aspectjrt.jar to the projects?
> >>>>> - It is not clear to me where to put the lib for
> >>>>> plugin projects. I ended up adding the absolute
> >>>>> path "Runtime Library" into each plugin.xml
> >>>>>
> >>>>>- How can I control adding the aspect (changes in the
> >>>>> .lst file seems to have no effect on plugins)
> >>>>>
> >>>>>- Can I add the aspect without modifying existing projects?
> >>>>>
> >>>>>Thanks for listening
> >>>>>
> >>>>>Michael
> >>>>
> >>>>
> >>>
> >
> >
Re: How to add aspects to multiple eclipse plugin projects? [message #579685 is a reply to message #35582] Wed, 19 May 2004 00:53 Go to previous message
Corville Allen is currently offline Corville Allen
Messages: 2
Registered: July 2009
Junior Member
I am also interested in a solution for this.

I would like to use a separate project for my aspects, and having the
aspects dynamically link to other projects that marks it as dependent.

"Michael Scharf" <Michael-Scharf@gmx.de> wrote in message
news:c7p9ob$3s3$1@eclipse.org...
> Hi,
>
> I want to "aspectize" multiple projects with AJDT/aspectj.
>
> Suppose, I want to add a simple tracing aspect to all
> public methods that are called "run".
>
> public aspect TraceRun {
> pointcut run(): execution(public * *.run(..));
> before() : run() {
> System.out.println("TRACE "+thisJoinPoint);
> }
> }
>
> I want to add this aspect to the entire workbench or
> at a set of projects. Ideally I would like to have
> independent plugins/projects with aspects and "inject"
> the code into my unmodified eclipse plugins. Is this
> possible?
>
> Here some concrete questions:
>
> - Is aspectj supported for eclipse plugins or only for
> stand alone applications?
>
> - How to best add aspects to a a set of plugin projects?
> - Can aspects cross project/plugin boundaries?
> - Is there a better way than to copy the aspect into
> each project?
> <library
name=" c:/eclipse/3.0M8/eclipse/plugins/org.aspectj.ajde_1.1.8/aspe ctjrt.jar "
>
> <export name="*"/>
> </library>
>
> - How to add the aspectjrt.jar to the projects?
> - It is not clear to me where to put the lib for
> plugin projects. I ended up adding the absolute
> path "Runtime Library" into each plugin.xml
>
> - How can I control adding the aspect (changes in the
> .lst file seems to have no effect on plugins)
>
> - Can I add the aspect without modifying existing projects?
>
> Thanks for listening
>
> Michael
Re: How to add aspects to multiple eclipse plugin projects? [message #581326 is a reply to message #35820] Wed, 14 July 2004 09:28 Go to previous message
Dennis Fuglsang is currently offline Dennis Fuglsang
Messages: 77
Registered: July 2009
Member
Corville or Michael,

I am hoping that one of you can provide me with some guidance since it does
not appear that I am getting responses from my other postings. What I am
simply trying to do is develope a eclipse plugin project that adds some
debugging/tracing support to one or more of the org.eclipse.emf projects (or
any other org.eclipse plugin). The plugin containing my aspects depends
upon those org.eclipse projects. It compiles successfully and appears to
correctly modify the appropriate class files (I also see the aspect class
file within the output jar). I encounter problems when I try running my
application in the Eclipse runtime environment. When the pointcut is
encountered in the org.eclipse
code I get a java.lang.NoClassDefFoundError exception listing my aspect
class.

Do the aspects and the code containing the join points need to be in the
same Eclipse project? That would seem to severly limit the power of
cross-cutting multiple projects. How do Eclipse project dependencies and
project classloaders work with aspects and AJDT?

Any help you can provide would be greatly appreciated. Thanks

Dennis Fuglsang



"Corville Allen" <corville@us.ibm.com> wrote in message
news:c8eorl$9d4$1@eclipse.org...
> I am also interested in a solution for this.
>
> I would like to use a separate project for my aspects, and having the
> aspects dynamically link to other projects that marks it as dependent.
>
> "Michael Scharf" <Michael-Scharf@gmx.de> wrote in message
> news:c7p9ob$3s3$1@eclipse.org...
> > Hi,
> >
> > I want to "aspectize" multiple projects with AJDT/aspectj.
> >
> > Suppose, I want to add a simple tracing aspect to all
> > public methods that are called "run".
> >
> > public aspect TraceRun {
> > pointcut run(): execution(public * *.run(..));
> > before() : run() {
> > System.out.println("TRACE "+thisJoinPoint);
> > }
> > }
> >
> > I want to add this aspect to the entire workbench or
> > at a set of projects. Ideally I would like to have
> > independent plugins/projects with aspects and "inject"
> > the code into my unmodified eclipse plugins. Is this
> > possible?
> >
> > Here some concrete questions:
> >
> > - Is aspectj supported for eclipse plugins or only for
> > stand alone applications?
> >
> > - How to best add aspects to a a set of plugin projects?
> > - Can aspects cross project/plugin boundaries?
> > - Is there a better way than to copy the aspect into
> > each project?
> > <library
>
name=" c:/eclipse/3.0M8/eclipse/plugins/org.aspectj.ajde_1.1.8/aspe ctjrt.jar "
> >
> > <export name="*"/>
> > </library>
> >
> > - How to add the aspectjrt.jar to the projects?
> > - It is not clear to me where to put the lib for
> > plugin projects. I ended up adding the absolute
> > path "Runtime Library" into each plugin.xml
> >
> > - How can I control adding the aspect (changes in the
> > .lst file seems to have no effect on plugins)
> >
> > - Can I add the aspect without modifying existing projects?
> >
> > Thanks for listening
> >
> > Michael
>
>
Re: How to add aspects to multiple eclipse plugin projects? [message #581345 is a reply to message #38259] Wed, 14 July 2004 16:57 Go to previous message
George Harley is currently offline George Harley
Messages: 70
Registered: July 2009
Member
Hi Dennis,

Does your plug-in have a dependency on the org.aspectj.ajde plug-in ? If
not, how are you adding the necessary aspectjrt.jar to your plug-in's
runtime classpath ?

Best regards,
George

Dennis Fuglsang wrote:
> Corville or Michael,
>
> I am hoping that one of you can provide me with some guidance since it does
> not appear that I am getting responses from my other postings. What I am
> simply trying to do is develope a eclipse plugin project that adds some
> debugging/tracing support to one or more of the org.eclipse.emf projects (or
> any other org.eclipse plugin). The plugin containing my aspects depends
> upon those org.eclipse projects. It compiles successfully and appears to
> correctly modify the appropriate class files (I also see the aspect class
> file within the output jar). I encounter problems when I try running my
> application in the Eclipse runtime environment. When the pointcut is
> encountered in the org.eclipse
> code I get a java.lang.NoClassDefFoundError exception listing my aspect
> class.
>
> Do the aspects and the code containing the join points need to be in the
> same Eclipse project? That would seem to severly limit the power of
> cross-cutting multiple projects. How do Eclipse project dependencies and
> project classloaders work with aspects and AJDT?
>
> Any help you can provide would be greatly appreciated. Thanks
>
> Dennis Fuglsang
>
>
>
> "Corville Allen" <corville@us.ibm.com> wrote in message
> news:c8eorl$9d4$1@eclipse.org...
>
>>I am also interested in a solution for this.
>>
>>I would like to use a separate project for my aspects, and having the
>>aspects dynamically link to other projects that marks it as dependent.
>>
>>"Michael Scharf" <Michael-Scharf@gmx.de> wrote in message
>>news:c7p9ob$3s3$1@eclipse.org...
>>
>>>Hi,
>>>
>>>I want to "aspectize" multiple projects with AJDT/aspectj.
>>>
>>>Suppose, I want to add a simple tracing aspect to all
>>>public methods that are called "run".
>>>
>>> public aspect TraceRun {
>>>pointcut run(): execution(public * *.run(..));
>>>before() : run() {
>>>System.out.println("TRACE "+thisJoinPoint);
>>>}
>>> }
>>>
>>>I want to add this aspect to the entire workbench or
>>>at a set of projects. Ideally I would like to have
>>>independent plugins/projects with aspects and "inject"
>>>the code into my unmodified eclipse plugins. Is this
>>>possible?
>>>
>>>Here some concrete questions:
>>>
>>>- Is aspectj supported for eclipse plugins or only for
>>> stand alone applications?
>>>
>>>- How to best add aspects to a a set of plugin projects?
>>> - Can aspects cross project/plugin boundaries?
>>> - Is there a better way than to copy the aspect into
>>> each project?
>>> <library
>>
> name=" c:/eclipse/3.0M8/eclipse/plugins/org.aspectj.ajde_1.1.8/aspe ctjrt.jar "
>
>>> <export name="*"/>
>>> </library>
>>>
>>>- How to add the aspectjrt.jar to the projects?
>>> - It is not clear to me where to put the lib for
>>> plugin projects. I ended up adding the absolute
>>> path "Runtime Library" into each plugin.xml
>>>
>>>- How can I control adding the aspect (changes in the
>>> .lst file seems to have no effect on plugins)
>>>
>>>- Can I add the aspect without modifying existing projects?
>>>
>>>Thanks for listening
>>>
>>>Michael
>>
>>
>
>
Re: How to add aspects to multiple eclipse plugin projects? [message #581388 is a reply to message #38292] Thu, 15 July 2004 10:06 Go to previous message
Dennis Fuglsang is currently offline Dennis Fuglsang
Messages: 77
Registered: July 2009
Member
Thank you for your reply George,

The plugin project containing the aspects, call it "dev", is an AspectJ
project so that build path has a reference to the aspectjrt.jar. The
project I am trying to pointcut, org.eclipse.emf.ecore, I have added
org.aspectj.ajde as a project dependency. Still when I launch my
application, contained in a plugin project called "test", I encounter a
java.lang.NoClassDefFoundError exception when the pointcut is encountered in
the org.eclipse.emf.ecore plugin. Do I only need aspectjrt.jar in the
runtime classpath of the plugins that were modified? Any suggestions?

Thanks in advance,

Dennis Fuglsang

"George Harley" <george_harley@ntlworld.com> wrote in message
news:cd46ll$cnk$1@eclipse.org...
> Hi Dennis,
>
> Does your plug-in have a dependency on the org.aspectj.ajde plug-in ? If
> not, how are you adding the necessary aspectjrt.jar to your plug-in's
> runtime classpath ?
>
> Best regards,
> George
>
> Dennis Fuglsang wrote:
> > Corville or Michael,
> >
> > I am hoping that one of you can provide me with some guidance since it
does
> > not appear that I am getting responses from my other postings. What I
am
> > simply trying to do is develope a eclipse plugin project that adds some
> > debugging/tracing support to one or more of the org.eclipse.emf projects
(or
> > any other org.eclipse plugin). The plugin containing my aspects depends
> > upon those org.eclipse projects. It compiles successfully and appears
to
> > correctly modify the appropriate class files (I also see the aspect
class
> > file within the output jar). I encounter problems when I try running
my
> > application in the Eclipse runtime environment. When the pointcut is
> > encountered in the org.eclipse
> > code I get a java.lang.NoClassDefFoundError exception listing my aspect
> > class.
> >
> > Do the aspects and the code containing the join points need to be in the
> > same Eclipse project? That would seem to severly limit the power of
> > cross-cutting multiple projects. How do Eclipse project dependencies
and
> > project classloaders work with aspects and AJDT?
> >
> > Any help you can provide would be greatly appreciated. Thanks
> >
> > Dennis Fuglsang
> >
> >
> >
> > "Corville Allen" <corville@us.ibm.com> wrote in message
> > news:c8eorl$9d4$1@eclipse.org...
> >
> >>I am also interested in a solution for this.
> >>
> >>I would like to use a separate project for my aspects, and having the
> >>aspects dynamically link to other projects that marks it as dependent.
> >>
> >>"Michael Scharf" <Michael-Scharf@gmx.de> wrote in message
> >>news:c7p9ob$3s3$1@eclipse.org...
> >>
> >>>Hi,
> >>>
> >>>I want to "aspectize" multiple projects with AJDT/aspectj.
> >>>
> >>>Suppose, I want to add a simple tracing aspect to all
> >>>public methods that are called "run".
> >>>
> >>> public aspect TraceRun {
> >>>pointcut run(): execution(public * *.run(..));
> >>>before() : run() {
> >>>System.out.println("TRACE "+thisJoinPoint);
> >>>}
> >>> }
> >>>
> >>>I want to add this aspect to the entire workbench or
> >>>at a set of projects. Ideally I would like to have
> >>>independent plugins/projects with aspects and "inject"
> >>>the code into my unmodified eclipse plugins. Is this
> >>>possible?
> >>>
> >>>Here some concrete questions:
> >>>
> >>>- Is aspectj supported for eclipse plugins or only for
> >>> stand alone applications?
> >>>
> >>>- How to best add aspects to a a set of plugin projects?
> >>> - Can aspects cross project/plugin boundaries?
> >>> - Is there a better way than to copy the aspect into
> >>> each project?
> >>> <library
> >>
> >
name=" c:/eclipse/3.0M8/eclipse/plugins/org.aspectj.ajde_1.1.8/aspe ctjrt.jar "
> >
> >>> <export name="*"/>
> >>> </library>
> >>>
> >>>- How to add the aspectjrt.jar to the projects?
> >>> - It is not clear to me where to put the lib for
> >>> plugin projects. I ended up adding the absolute
> >>> path "Runtime Library" into each plugin.xml
> >>>
> >>>- How can I control adding the aspect (changes in the
> >>> .lst file seems to have no effect on plugins)
> >>>
> >>>- Can I add the aspect without modifying existing projects?
> >>>
> >>>Thanks for listening
> >>>
> >>>Michael
> >>
> >>
> >
> >
Re: How to add aspects to multiple eclipse plugin projects? [message #581521 is a reply to message #38358] Thu, 15 July 2004 19:46 Go to previous message
George Harley is currently offline George Harley
Messages: 70
Registered: July 2009
Member
Hi Dennis,

So, if I understand correctly, your setup is as follows...

1. Plug-in project called "dev". Has AspectJ nature, contains aspects.
2. Plug-in project org.eclipse.emf.core. Does this have an AspectJ
nature ? Does it contain any aspect code ? Have you woven in your
aspects (from "dev") ? Did you carry out binary weaving against any jars
in this project or are you building against its source ?
3. Plug-in project called "test". Does this have an AspectJ nature ? Is
it just ordinary Java calling into your org.eclipse.emf.core plug-in ?

Assuming the above summary is correct (?), how have you configured the
dependencies between these different plug-ins ? Where are your compiled
aspects at runtime and where are the classes that you have woven into ?

I would really like to help you out here but until I get a better
understanding of the topography of your workbench then I am of limited
use (even more than usual!). If you want to mail me off-group with more
details on your projects then I will see what I can do. What you are
trying to do *should* be possible...

Best regards,
George


Dennis Fuglsang wrote:
> Thank you for your reply George,
>
> The plugin project containing the aspects, call it "dev", is an AspectJ
> project so that build path has a reference to the aspectjrt.jar. The
> project I am trying to pointcut, org.eclipse.emf.ecore, I have added
> org.aspectj.ajde as a project dependency. Still when I launch my
> application, contained in a plugin project called "test", I encounter a
> java.lang.NoClassDefFoundError exception when the pointcut is encountered in
> the org.eclipse.emf.ecore plugin. Do I only need aspectjrt.jar in the
> runtime classpath of the plugins that were modified? Any suggestions?
>
> Thanks in advance,
>
> Dennis Fuglsang
>
> "George Harley" <george_harley@ntlworld.com> wrote in message
> news:cd46ll$cnk$1@eclipse.org...
>
>>Hi Dennis,
>>
>>Does your plug-in have a dependency on the org.aspectj.ajde plug-in ? If
>>not, how are you adding the necessary aspectjrt.jar to your plug-in's
>>runtime classpath ?
>>
>>Best regards,
>>George
>>
>>Dennis Fuglsang wrote:
>>
>>>Corville or Michael,
>>>
>>>I am hoping that one of you can provide me with some guidance since it
>
> does
>
>>>not appear that I am getting responses from my other postings. What I
>
> am
>
>>>simply trying to do is develope a eclipse plugin project that adds some
>>>debugging/tracing support to one or more of the org.eclipse.emf projects
>
> (or
>
>>>any other org.eclipse plugin). The plugin containing my aspects depends
>>>upon those org.eclipse projects. It compiles successfully and appears
>
> to
>
>>>correctly modify the appropriate class files (I also see the aspect
>
> class
>
>>>file within the output jar). I encounter problems when I try running
>
> my
>
>>>application in the Eclipse runtime environment. When the pointcut is
>>>encountered in the org.eclipse
>>>code I get a java.lang.NoClassDefFoundError exception listing my aspect
>>>class.
>>>
>>>Do the aspects and the code containing the join points need to be in the
>>>same Eclipse project? That would seem to severly limit the power of
>>>cross-cutting multiple projects. How do Eclipse project dependencies
>
> and
>
>>>project classloaders work with aspects and AJDT?
>>>
>>>Any help you can provide would be greatly appreciated. Thanks
>>>
>>>Dennis Fuglsang
>>>
>>>
>>>
>>>"Corville Allen" <corville@us.ibm.com> wrote in message
>>>news:c8eorl$9d4$1@eclipse.org...
>>>
>>>
>>>>I am also interested in a solution for this.
>>>>
>>>>I would like to use a separate project for my aspects, and having the
>>>>aspects dynamically link to other projects that marks it as dependent.
>>>>
>>>>"Michael Scharf" <Michael-Scharf@gmx.de> wrote in message
>>>>news:c7p9ob$3s3$1@eclipse.org...
>>>>
>>>>
>>>>>Hi,
>>>>>
>>>>>I want to "aspectize" multiple projects with AJDT/aspectj.
>>>>>
>>>>>Suppose, I want to add a simple tracing aspect to all
>>>>>public methods that are called "run".
>>>>>
>>>>> public aspect TraceRun {
>>>>>pointcut run(): execution(public * *.run(..));
>>>>>before() : run() {
>>>>>System.out.println("TRACE "+thisJoinPoint);
>>>>>}
>>>>> }
>>>>>
>>>>>I want to add this aspect to the entire workbench or
>>>>>at a set of projects. Ideally I would like to have
>>>>>independent plugins/projects with aspects and "inject"
>>>>>the code into my unmodified eclipse plugins. Is this
>>>>>possible?
>>>>>
>>>>>Here some concrete questions:
>>>>>
>>>>>- Is aspectj supported for eclipse plugins or only for
>>>>> stand alone applications?
>>>>>
>>>>>- How to best add aspects to a a set of plugin projects?
>>>>> - Can aspects cross project/plugin boundaries?
>>>>> - Is there a better way than to copy the aspect into
>>>>> each project?
>>>>> <library
>>>>
> name=" c:/eclipse/3.0M8/eclipse/plugins/org.aspectj.ajde_1.1.8/aspe ctjrt.jar "
>
>>>>> <export name="*"/>
>>>>> </library>
>>>>>
>>>>>- How to add the aspectjrt.jar to the projects?
>>>>> - It is not clear to me where to put the lib for
>>>>> plugin projects. I ended up adding the absolute
>>>>> path "Runtime Library" into each plugin.xml
>>>>>
>>>>>- How can I control adding the aspect (changes in the
>>>>> .lst file seems to have no effect on plugins)
>>>>>
>>>>>- Can I add the aspect without modifying existing projects?
>>>>>
>>>>>Thanks for listening
>>>>>
>>>>>Michael
>>>>
>>>>
>>>
>
>
Re: How to add aspects to multiple eclipse plugin projects? [message #582037 is a reply to message #38525] Thu, 22 July 2004 15:59 Go to previous message
Dennis Fuglsang is currently offline Dennis Fuglsang
Messages: 77
Registered: July 2009
Member
George,

Thank you for your responses and your offer to work with me offline. I have
solved my mysterious NoClassDefFoundError. The plugin.xml for the project
we were "aspectizing" contained a package prefix declaration that defines
the list of package prefixes for the runtime library. The problem was that
the list of package prefixes did not include the package for the aspect I
was weaving into the project. In other words, even though my output jar
from the AspectJ compiler included my aspect class the classloader for that
plugin could not find it because it was not in the "org.eclipse.emf.core*"
package. I had looked at the plugin.xml numerous times but for some reason
I was discounted the <packages prefixes> as a problem.
<requires>
<import plugin="org.apache.xerces"/>
<import plugin="org.eclipse.core.resources"/>
<import plugin="org.eclipse.emf.common" export="true"/>
<import plugin="org.aspectj.ajde"/>
</requires>

<runtime>
<library name="runtime/ecore_AOP.jar">
<export name="*"/>
</library>
<library name="runtime/ecore.jar">
<export name="*"/>
<packages prefixes="org.eclipse.emf.ecore"/> <<<<<<============ this
was my problem
</library>
</runtime>


Once I removed the package prefix list in my plugin.xml the aspects started
working. Yaaaahoooo!

--Dennis Fuglsang

"George Harley" <george_harley@ntlworld.com> wrote in message
news:cd74tl$49m$1@eclipse.org...
> Hi Dennis,
>
> So, if I understand correctly, your setup is as follows...
>
> 1. Plug-in project called "dev". Has AspectJ nature, contains aspects.
> 2. Plug-in project org.eclipse.emf.core. Does this have an AspectJ
> nature ? Does it contain any aspect code ? Have you woven in your
> aspects (from "dev") ? Did you carry out binary weaving against any jars
> in this project or are you building against its source ?
> 3. Plug-in project called "test". Does this have an AspectJ nature ? Is
> it just ordinary Java calling into your org.eclipse.emf.core plug-in ?
>
> Assuming the above summary is correct (?), how have you configured the
> dependencies between these different plug-ins ? Where are your compiled
> aspects at runtime and where are the classes that you have woven into ?
>
> I would really like to help you out here but until I get a better
> understanding of the topography of your workbench then I am of limited
> use (even more than usual!). If you want to mail me off-group with more
> details on your projects then I will see what I can do. What you are
> trying to do *should* be possible...
>
> Best regards,
> George
>
>
> Dennis Fuglsang wrote:
> > Thank you for your reply George,
> >
> > The plugin project containing the aspects, call it "dev", is an AspectJ
> > project so that build path has a reference to the aspectjrt.jar. The
> > project I am trying to pointcut, org.eclipse.emf.ecore, I have added
> > org.aspectj.ajde as a project dependency. Still when I launch my
> > application, contained in a plugin project called "test", I encounter a
> > java.lang.NoClassDefFoundError exception when the pointcut is
encountered in
> > the org.eclipse.emf.ecore plugin. Do I only need aspectjrt.jar in the
> > runtime classpath of the plugins that were modified? Any suggestions?
> >
> > Thanks in advance,
> >
> > Dennis Fuglsang
> >
> > "George Harley" <george_harley@ntlworld.com> wrote in message
> > news:cd46ll$cnk$1@eclipse.org...
> >
> >>Hi Dennis,
> >>
> >>Does your plug-in have a dependency on the org.aspectj.ajde plug-in ? If
> >>not, how are you adding the necessary aspectjrt.jar to your plug-in's
> >>runtime classpath ?
> >>
> >>Best regards,
> >>George
> >>
> >>Dennis Fuglsang wrote:
> >>
> >>>Corville or Michael,
> >>>
> >>>I am hoping that one of you can provide me with some guidance since it
> >
> > does
> >
> >>>not appear that I am getting responses from my other postings. What I
> >
> > am
> >
> >>>simply trying to do is develope a eclipse plugin project that adds some

> >>>debugging/tracing support to one or more of the org.eclipse.emf
projects
> >
> > (or
> >
> >>>any other org.eclipse plugin). The plugin containing my aspects
depends
> >>>upon those org.eclipse projects. It compiles successfully and appears
> >
> > to
> >
> >>>correctly modify the appropriate class files (I also see the aspect
> >
> > class
> >
> >>>file within the output jar). I encounter problems when I try running
> >
> > my
> >
> >>>application in the Eclipse runtime environment. When the pointcut is
> >>>encountered in the org.eclipse
> >>>code I get a java.lang.NoClassDefFoundError exception listing my aspect
> >>>class.
> >>>
> >>>Do the aspects and the code containing the join points need to be in
the
> >>>same Eclipse project? That would seem to severly limit the power of
> >>>cross-cutting multiple projects. How do Eclipse project dependencies
> >
> > and
> >
> >>>project classloaders work with aspects and AJDT?
> >>>
> >>>Any help you can provide would be greatly appreciated. Thanks
> >>>
> >>>Dennis Fuglsang
> >>>
> >>>
> >>>
> >>>"Corville Allen" <corville@us.ibm.com> wrote in message
> >>>news:c8eorl$9d4$1@eclipse.org...
> >>>
> >>>
> >>>>I am also interested in a solution for this.
> >>>>
> >>>>I would like to use a separate project for my aspects, and having the
> >>>>aspects dynamically link to other projects that marks it as dependent.
> >>>>
> >>>>"Michael Scharf" <Michael-Scharf@gmx.de> wrote in message
> >>>>news:c7p9ob$3s3$1@eclipse.org...
> >>>>
> >>>>
> >>>>>Hi,
> >>>>>
> >>>>>I want to "aspectize" multiple projects with AJDT/aspectj.
> >>>>>
> >>>>>Suppose, I want to add a simple tracing aspect to all
> >>>>>public methods that are called "run".
> >>>>>
> >>>>> public aspect TraceRun {
> >>>>>pointcut run(): execution(public * *.run(..));
> >>>>>before() : run() {
> >>>>>System.out.println("TRACE "+thisJoinPoint);
> >>>>>}
> >>>>> }
> >>>>>
> >>>>>I want to add this aspect to the entire workbench or
> >>>>>at a set of projects. Ideally I would like to have
> >>>>>independent plugins/projects with aspects and "inject"
> >>>>>the code into my unmodified eclipse plugins. Is this
> >>>>>possible?
> >>>>>
> >>>>>Here some concrete questions:
> >>>>>
> >>>>>- Is aspectj supported for eclipse plugins or only for
> >>>>> stand alone applications?
> >>>>>
> >>>>>- How to best add aspects to a a set of plugin projects?
> >>>>> - Can aspects cross project/plugin boundaries?
> >>>>> - Is there a better way than to copy the aspect into
> >>>>> each project?
> >>>>> <library
> >>>>
> >
name=" c:/eclipse/3.0M8/eclipse/plugins/org.aspectj.ajde_1.1.8/aspe ctjrt.jar "
> >
> >>>>> <export name="*"/>
> >>>>> </library>
> >>>>>
> >>>>>- How to add the aspectjrt.jar to the projects?
> >>>>> - It is not clear to me where to put the lib for
> >>>>> plugin projects. I ended up adding the absolute
> >>>>> path "Runtime Library" into each plugin.xml
> >>>>>
> >>>>>- How can I control adding the aspect (changes in the
> >>>>> .lst file seems to have no effect on plugins)
> >>>>>
> >>>>>- Can I add the aspect without modifying existing projects?
> >>>>>
> >>>>>Thanks for listening
> >>>>>
> >>>>>Michael
> >>>>
> >>>>
> >>>
> >
> >
Previous Topic:Feedback on AJDT 1.1.11
Next Topic:Feedback on AJDT 1.1.11
Goto Forum:
  


Current Time: Thu Apr 17 23:44:52 EDT 2014

Powered by FUDForum. Page generated in 0.10046 seconds