Announcement Announcement Module
No announcement yet.
spring osgi with aspectj dependency injection on a prototype bean Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring osgi with aspectj dependency injection on a prototype bean


    I posted a question on a spring DM server forum ( and they suggested that I ask here.

    Let me try to describe the environment and the issue:

    * it's an eclipse RCP application that uses spring framework and spring DM on the client side
    * we use equinox aspects and LTW
    * we use equinox aspects with aspectj ITD to extend our prototype beans (eclipse views, composites, etc) with PropertyChangeSupport and it works fine
    * we started using spring @Configurable and @Autowired to mark some objects as spring configurable and it works like a charm if everything is declared in a single bundle under the same context
    * in order to use equinox aspects for weaving in spring context we use springweaver written by M. Lippert and posted on this forum

    The problem:
    * if I introduce another bundle that has it's own spring context and if I try to instantiate an object marked as @Configurable everything seems to work fine until I try to use an object from a previous context/bundle.

    It seems that AnnotationBeanConfigurerAspect is a singleton aspect shared among all spring contexts, and BeanFactory gets replaced each time setBeanFactory is called.

    That means that each spring osgi context replaces BeanFactory of the previous one.

    I found related issues on JIRA:

    "Obvious" solution is to create new "OsgiImproved"AnnotationBeanConfigurerAspect bound to the singe spring context but I'm unable to figure out how to do it. Does someone have an idea how to enable spring / aspectj LTW in an OSGI environment?
    Last edited by iloncar; Jul 6th, 2009, 04:03 PM.

  • #2
    I'm jumping between AOP, Spring DM and DM server forums.

    For more information see updated thread on