Announcement Announcement Module
Collapse
No announcement yet.
Best way to resolve optional dependencies? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Best way to resolve optional dependencies?

    Given a bundle A that optionally resolves packages from Bundle B, what is the best way to install Bundle B so that Bundle A's dependencies are satisfied? For example...

    Bundle org.springframework.aop-3.0.0.CI-395.jar imports package net.sf.cglib.core, with a "resolution:=optional" directive. On a clean start of dm Server 2.0.0.M5, this import is not resolved. (Go to Admin > OSGi State, and select the org.springframework.aop bundle. The provider for net.sf.cglib.core is blank.)

    I tried adding com.springsource.net.sf.cglib-2.1.3.jar to SERVER_HOME/repository/usr, and then to SERVER_HOME/repository/ext, but still the optional resolution did not take place. I restarted the server and refreshed the org.springframework.aop bundle after each of these attempts.

    When I add "file:repository/usr/com.springsource.net.sf.cglib-2.1.3.jar" to com.springsource.kernel.region.bundles in com.springsource.kernel.launch.properties, then the import resolved as expected, and the aop package had access to cglib.

    Is it necessary to add all "optional" bundles to com.springsource.kernel.launch.properties? Based on the user's guide (http://static.springsource.org/s2-dm...l/ch04s03.html), I thought that putting them in SERVER_HOME/repository/usr or SERVER_HOME/repository/ext was sufficient.

  • #2
    Originally posted by kinman View Post
    Given a bundle A that optionally resolves packages from Bundle B, what is the best way to install Bundle B so that Bundle A's dependencies are satisfied? For example...

    Bundle org.springframework.aop-3.0.0.CI-395.jar imports package net.sf.cglib.core, with a "resolution:=optional" directive. On a clean start of dm Server 2.0.0.M5, this import is not resolved. (Go to Admin > OSGi State, and select the org.springframework.aop bundle. The provider for net.sf.cglib.core is blank.)

    I tried adding com.springsource.net.sf.cglib-2.1.3.jar to SERVER_HOME/repository/usr, and then to SERVER_HOME/repository/ext, but still the optional resolution did not take place. I restarted the server and refreshed the org.springframework.aop bundle after each of these attempts.

    When I add "file:repository/usr/com.springsource.net.sf.cglib-2.1.3.jar" to com.springsource.kernel.region.bundles in com.springsource.kernel.launch.properties, then the import resolved as expected, and the aop package had access to cglib.

    Is it necessary to add all "optional" bundles to com.springsource.kernel.launch.properties? Based on the user's guide (http://static.springsource.org/s2-dm...l/ch04s03.html), I thought that putting them in SERVER_HOME/repository/usr or SERVER_HOME/repository/ext was sufficient.
    With the current region implementation, (optional) dependencies of bundles listed in com.springsource.kernel.region.bundles are not automatically satisfied from the repository so, yes, you have to add all optional bundles to that property.

    This is an aspect of the region support we hope to improve. If you would like to track that improvement, please raise a user story.

    Comment

    Working...
    X