Announcement Announcement Module

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
Spring dependencies in bundle? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring dependencies in bundle?

    Which classes are visible to beans that are instantiated by the Spring extender when it creates the Spring context of a Spring-DM powered bundle? Are these only the classes that are visible to this bundle?

    Do I need to import Spring-classes in my bundle manifest?

    I ask this because I am having the following problem when I try to use a PropertyPlaceholderConfigurer inside my Spring context. I did not create the manifest such that it imports Spring classes. I (obviously from the stack trace!) do have the bundle org.sprinframework.beans activated but it looks like it cannot load classes from itself:

    org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.beans.factory.config.PropertyPlaceholderConfigurer] for bean with name 'org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0' defined in URL [bundleentry://271.fwk30758157/META-INF/spring/client/productDaoClient.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.beans.factory.config.PropertyPlaceholderConfigurer not found from bundle []

  • #2
    Yes, you need explicitly import any spring related classes. The class loader of the target bundle doesn't aware of spring.


    • #3
      Ok thank you for this information. I couldn't find this explicitly mentioned in the Spring-DM reference manual.


      • #4
        Originally posted by SlowStrider View Post
        Ok thank you for this information. I couldn't find this explicitly mentioned in the Spring-DM reference manual.
        I say explicitly means standard OSGi Import-Package header to import any class which may be loaded by spring osgi extender.

        SpringSource Bundlor aware of spring xml file and could generate header for you with required packages:


        • #5
          Spring DM uses only the bundle class space (which is not modified by it). If you are using Spring classes you need to import them. However using Spring DM doesn't require you to use Spring per se - that is, for its own internal usage, Spring DM takes care of loading the proper classes w/o requiring the user to import anything.

          In short, worry just about the classes that you load/use in your code/config and import them.