Skip to main content



      Home
Home » Language IDEs » AspectJ » How the Aspect Bundle run with Eclipse
How the Aspect Bundle run with Eclipse [message #1749044] Thu, 01 December 2016 07:29 Go to next message
Eclipse UserFriend
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 07:45 Go to previous messageGo to next message
Eclipse UserFriend
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 08:02 Go to previous messageGo to next message
Eclipse UserFriend
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 12:19 Go to previous messageGo to next message
Eclipse UserFriend
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] Thu, 01 December 2016 21:20 Go to previous messageGo to next message
Eclipse UserFriend
> 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 02:43 Go to previous message
Eclipse UserFriend
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 02:45] by Moderator

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


Current Time: Fri May 16 00:33:48 EDT 2025

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

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

Back to the top