Announcement Announcement Module
No announcement yet.
AspectJ not run in RCP Application Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • AspectJ not run in RCP Application

    Hi all,

    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
    The Netherlands.

  • #2
    Hi Bart,

    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.


    • #3
      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.


      • #4
        Found it!

        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.


        • #5
          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: since it is not Spring related, as far as I understand.