Oct 2nd, 2007, 03:40 AM
AspectJ not run in RCP Application
I'm trying to implement some aspects in an Eclipser RCP Application. After muddling with plugins a bit, the aspects now work (that is, the advice is run) when starting the Eclipse RCP app as a product from within the Eclipse IDE. However, the exported product does not run the advice (the rest works OK, no crashes or all that). It seems the aspects do not become active or loaded.
Anyone knows what might be going on?
Bart van Riel
Oct 2nd, 2007, 10:35 AM
when exporting a product using the product export wizard, not all plugins configured in the Run... configuration will be exported. the wizard starts at the product configuration and only exports those plugins needed to satisfy all (recursive) dependencies.
compare the plugins you checked in your Run... configuration with the ones exported to your product export plugins/ subdirectory. there are probably some missing.
Oct 2nd, 2007, 02:07 PM
Checked, changed, still does not work...
Thanx for the tip. I checked all the plugins and added some plugins to the required-plugins list of the plugin.
However, while everything works fine within the IDE, the pointcut still does not seem to get called in the exported, standalone app. Somehow, the aspect seems to get 'ignored'. I don't get any runtime errors though, so it would seem the aspectjrt.jar is in the classpath OK (the plugin it is contained in is exported properly, so this seems OK).
Any other ideas? Appreciate your help so far.
Bart van Riel.
Oct 4th, 2007, 02:47 AM
I checked the compiled code and found that the aspects were not compiled into the exported code. Apparently, when you use the product export wizard, the ajc compiler gets passed by. Solution is to use the "Export Product with AspectJ" export option directly from the "Export..." context menu and not use the standard export wizard link.
One new glitch though: the "Export Product with AspectJ" task breaks when your target platform for plugin development is not your IDE, but a seperate Eclipse installation. So exporting like that only works with the target platform set to the IDE installation.
Bart van Riel.
Oct 6th, 2007, 12:35 PM
Glad you got it sorted out. I was first assuming you were using Spring-AOP which requires no special compiling/weaving of aspectj code.
Regarding the "Export Product..." problem, it is probably best to raise this issue with the AJDT/Eclipse Team: http://www.eclipse.org/ajdt/ since it is not Spring related, as far as I understand.