Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » Help for newbie
Help for newbie [message #37870] Thu, 01 July 2004 15:14 Go to next message
Lance Phillips is currently offline Lance Phillips
Messages: 210
Registered: July 2009
Senior Member
I am brand new to using AOP and ajdt, so bare with me if the questions are
overly simplistic!

We are just trying to POC some AOP stuff. We are using Eclipse 3.0 GA and
running our code with Eclipse 2.1 as the target platform. We'd like to add
some simple logging mechanisms to prove out our ability to add hooks to core
EMF method calls. How do we take an Eclipse 2.1 EMF plugin (which is
included as a binary PDE project in our workspace) and add our apects to it?

thanks,

lp
Re: Help for newbie [message #37905 is a reply to message #37870] Thu, 01 July 2004 21:04 Go to previous messageGo to next message
Lance Phillips is currently offline Lance Phillips
Messages: 210
Registered: July 2009
Senior Member
Here is what I have figured out so far...
I created a new a new PDE project and added my aspects here. I converted it
to a converted this new project to an AspectJ project.
I export all my aspects to a jar file withing this project.
I right click on this project and select properties. From here I bring up
the AspectJ option.
In the input jars (classes) field I select the jar file for my EMF plugin.
In the input jars (aspects) field I select the aspects jar created above.
In the output jar field I enter a new jar name in the EMF plugin (I tried
leaving this blank to try to force overwritting the existing jar and got
some wierd EOF errors).
Use incremental comilation checked
Create a structure model... checked
Create Aspects in.java file.... not checked
Apply and exit.
Click the AspectJ builder button and my new jars get built. To make this
work my new aspect project must have dependencies to anything that will be
affected by the build (my EMF project).
Include my new jars in the classpath and plugin.xml for my EMF project.

When I run I get all kinds of NoClassDefFound errors. Every time my aspect
tries to get accessed the class loader can't find the aspect.

HELP!!!

"Lance Phillips" <lphillips@metamatrix.com> wrote in message
news:cc19nq$80i$1@eclipse.org...
> I am brand new to using AOP and ajdt, so bare with me if the questions are
> overly simplistic!
>
> We are just trying to POC some AOP stuff. We are using Eclipse 3.0 GA and
> running our code with Eclipse 2.1 as the target platform. We'd like to
add
> some simple logging mechanisms to prove out our ability to add hooks to
core
> EMF method calls. How do we take an Eclipse 2.1 EMF plugin (which is
> included as a binary PDE project in our workspace) and add our apects to
it?
>
> thanks,
>
> lp
>
>
Re: Help for newbie [message #37939 is a reply to message #37870] Thu, 01 July 2004 21:26 Go to previous message
Dennis Fuglsang is currently offline Dennis Fuglsang
Messages: 77
Registered: July 2009
Member
To simplify Lance's scenario even further lets say I have two Eclipse plugin
projects: ProjectA and ProjectB. ProjectA is an aspectJ project containing
the aspect classes that I would like to use for cross-cutting ProjectB.
ProjectA has a plugin dependency to ProjectB. If I go to ProjectA
properties -> AspectJ dialog I can specify the ProjectB jar file as the
"Input jars (classes)" value and the ProjectA jar as the "Input jars
(aspects)" value. I also specify the name of a new ProjectB jar for the
"Output jar" value. When I build ProjectA it appears that I create an
output jar with the aspects successfully weaved into the ProjectB classes
(In fact, I see the aspect class file within the output jar). The problem
comes when I try running in the Eclipse runtime environment as soon as the
ProjectB plugin gets activated and I hit the join point I get a
java.lang.NoClassDefFoundError listing the aspect in ProjectA.

It seems to me that the power of AOP is being able to point cut multiple
classes and plugins without them having a project dependency on my aspect
plugin. Is that correct?

Am I doing something wrong in how I am building the output jar?

If anyone can provide any insight into how to setup the project dependencies
and weave the aspects in this example I would greatly appreciate the help.
Thanks.

Dennis Fuglsang

"Lance Phillips" <lphillips@metamatrix.com> wrote in message
news:cc19nq$80i$1@eclipse.org...
> I am brand new to using AOP and ajdt, so bare with me if the questions are
> overly simplistic!
>
> We are just trying to POC some AOP stuff. We are using Eclipse 3.0 GA and
> running our code with Eclipse 2.1 as the target platform. We'd like to
add
> some simple logging mechanisms to prove out our ability to add hooks to
core
> EMF method calls. How do we take an Eclipse 2.1 EMF plugin (which is
> included as a binary PDE project in our workspace) and add our apects to
it?
>
> thanks,
>
> lp
>
>
Re: Help for newbie [message #581109 is a reply to message #37870] Thu, 01 July 2004 21:04 Go to previous message
Lance Phillips is currently offline Lance Phillips
Messages: 210
Registered: July 2009
Senior Member
Here is what I have figured out so far...
I created a new a new PDE project and added my aspects here. I converted it
to a converted this new project to an AspectJ project.
I export all my aspects to a jar file withing this project.
I right click on this project and select properties. From here I bring up
the AspectJ option.
In the input jars (classes) field I select the jar file for my EMF plugin.
In the input jars (aspects) field I select the aspects jar created above.
In the output jar field I enter a new jar name in the EMF plugin (I tried
leaving this blank to try to force overwritting the existing jar and got
some wierd EOF errors).
Use incremental comilation checked
Create a structure model... checked
Create Aspects in.java file.... not checked
Apply and exit.
Click the AspectJ builder button and my new jars get built. To make this
work my new aspect project must have dependencies to anything that will be
affected by the build (my EMF project).
Include my new jars in the classpath and plugin.xml for my EMF project.

When I run I get all kinds of NoClassDefFound errors. Every time my aspect
tries to get accessed the class loader can't find the aspect.

HELP!!!

"Lance Phillips" <lphillips@metamatrix.com> wrote in message
news:cc19nq$80i$1@eclipse.org...
> I am brand new to using AOP and ajdt, so bare with me if the questions are
> overly simplistic!
>
> We are just trying to POC some AOP stuff. We are using Eclipse 3.0 GA and
> running our code with Eclipse 2.1 as the target platform. We'd like to
add
> some simple logging mechanisms to prove out our ability to add hooks to
core
> EMF method calls. How do we take an Eclipse 2.1 EMF plugin (which is
> included as a binary PDE project in our workspace) and add our apects to
it?
>
> thanks,
>
> lp
>
>
Re: Help for newbie [message #581125 is a reply to message #37870] Thu, 01 July 2004 21:26 Go to previous message
Dennis Fuglsang is currently offline Dennis Fuglsang
Messages: 77
Registered: July 2009
Member
To simplify Lance's scenario even further lets say I have two Eclipse plugin
projects: ProjectA and ProjectB. ProjectA is an aspectJ project containing
the aspect classes that I would like to use for cross-cutting ProjectB.
ProjectA has a plugin dependency to ProjectB. If I go to ProjectA
properties -> AspectJ dialog I can specify the ProjectB jar file as the
"Input jars (classes)" value and the ProjectA jar as the "Input jars
(aspects)" value. I also specify the name of a new ProjectB jar for the
"Output jar" value. When I build ProjectA it appears that I create an
output jar with the aspects successfully weaved into the ProjectB classes
(In fact, I see the aspect class file within the output jar). The problem
comes when I try running in the Eclipse runtime environment as soon as the
ProjectB plugin gets activated and I hit the join point I get a
java.lang.NoClassDefFoundError listing the aspect in ProjectA.

It seems to me that the power of AOP is being able to point cut multiple
classes and plugins without them having a project dependency on my aspect
plugin. Is that correct?

Am I doing something wrong in how I am building the output jar?

If anyone can provide any insight into how to setup the project dependencies
and weave the aspects in this example I would greatly appreciate the help.
Thanks.

Dennis Fuglsang

"Lance Phillips" <lphillips@metamatrix.com> wrote in message
news:cc19nq$80i$1@eclipse.org...
> I am brand new to using AOP and ajdt, so bare with me if the questions are
> overly simplistic!
>
> We are just trying to POC some AOP stuff. We are using Eclipse 3.0 GA and
> running our code with Eclipse 2.1 as the target platform. We'd like to
add
> some simple logging mechanisms to prove out our ability to add hooks to
core
> EMF method calls. How do we take an Eclipse 2.1 EMF plugin (which is
> included as a binary PDE project in our workspace) and add our apects to
it?
>
> thanks,
>
> lp
>
>
Previous Topic:Help for newbie
Next Topic:AJDT 1.1.10 Samples problem with Eclipse 3.0
Goto Forum:
  


Current Time: Tue Sep 30 11:57:57 GMT 2014

Powered by FUDForum. Page generated in 0.01720 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software