Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » AJDT » How the Aspect Bundle run with Eclipse
How the Aspect Bundle run with Eclipse [message #1749044] Thu, 01 December 2016 12:29 Go to next message
Wang Chaobin is currently offline Wang ChaobinFriend
Messages: 7
Registered: September 2013
Junior Member
Hi,

I've wrote a plugin using AJDT, when I run my source as Eclipse Application, the aspects works.
But when I exports the source as a plugin and move the plugin.jar to my Eclipse_Root/plugins directory, the plugin runs wield.
- source of UI part runs well, extension point(org.eclipse.ui.menus) part shows in UI
- source of Aspects part does't work, as my log in around method doesn't log anything.
My config.ini was set like below:

osgi.bundles=reference\:file\:org.eclipse.equinox.simpleconfigurator_1.0.301.v20120914-163612.jar@1\:start,reference\:file\:org.eclipse.equinox.weaving.aspectj_1.0.300.I20130319-1000.jar@2\:start
org.eclipse.equinox.simpleconfigurator.configUrl=file\:org.eclipse.equinox.simpleconfigurator/bundles.info
osgi.framework.extensions=reference\:file\:org.eclipse.equinox.weaving.hook_1.0.200.I20130319-1000/,reference\:file\:anotherhook_6.1.0.201611291908/


Anything hints? Thanks in advance.
Re: How the Aspect Bundle run with Eclipse [message #1749048 is a reply to message #1749044] Thu, 01 December 2016 12:45 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 382
Registered: July 2009
Senior Member
Hard to say what's going on here as it's been years since I worked with this. Make sure that your aspects are getting compiled and exported into the plugin as expected.

Also, make sure that your aspects are properly specified in your manifest files as described here: https://wiki.eclipse.org/Equinox_Weaving_QuickStart
Re: How the Aspect Bundle run with Eclipse [message #1749050 is a reply to message #1749048] Thu, 01 December 2016 13:02 Go to previous messageGo to next message
Wang Chaobin is currently offline Wang ChaobinFriend
Messages: 7
Registered: September 2013
Junior Member
I just follow the wiki and [run as Eclipse Application] works well, so I think the MF is not the problem.
How could I confirm the aspects getting compiled?
The AJDT uses the Equinox weaving and modify the class file before target plugin is activated(? I think) Before the Eclipse starting, the class file should be modified by aspects?
Re: How the Aspect Bundle run with Eclipse [message #1749086 is a reply to message #1749050] Thu, 01 December 2016 17:19 Go to previous messageGo to next message
Andrew Eisenberg is currently offline Andrew EisenbergFriend
Messages: 382
Registered: July 2009
Senior Member
You need to open up the jar files and make sure that all of your .aj files have been compiled into .class files. Also, you need to make sure that the org.aspectj bundle is in your osgi manifest. Equinox weaving will weave your aspects into the java files when the java files are loaded.
Re: How the Aspect Bundle run with Eclipse [message #1749117 is a reply to message #1749086] Fri, 02 December 2016 02:20 Go to previous messageGo to next message
Wang Chaobin is currently offline Wang ChaobinFriend
Messages: 7
Registered: September 2013
Junior Member
> You need to open up the jar files and make sure that all of your .aj files have been compiled into .class files.
.aj and .class are both there in plugin.jar

> Also, you need to make sure that the org.aspectj bundle is in your osgi manifest.
Seems ok.
Require-Bundle: org.aspectj.runtime;bundle-version="1.7.3",
...


> Equinox weaving will weave your aspects into the java files when the java files are loaded.
Maybe I have some misunderstandings. As your sayings, first weave .java file, then do ajbuild into .class, is that means I should have all the source bundles in my eclipse?
Re: How the Aspect Bundle run with Eclipse [message #1749125 is a reply to message #1749117] Fri, 02 December 2016 07:43 Go to previous message
Wang Chaobin is currently offline Wang ChaobinFriend
Messages: 7
Registered: September 2013
Junior Member
Done. Thanks@Andrew.
My mistake. Just make sure the aspects being compiled and MF being right would be OK. No need to contain source bundles.

[Updated on: Fri, 02 December 2016 07:45]

Report message to a moderator

Previous Topic:AJDT does not see aspect library when the library is in workspace
Next Topic:AspectJ problem
Goto Forum:
  


Current Time: Wed Dec 13 11:27:56 GMT 2017

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

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