Results 1 to 2 of 2

Thread: Best way to resolve optional dependencies?

  1. #1
    Join Date
    Oct 2009
    Posts
    5

    Default 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. #2
    Join Date
    Oct 2008
    Location
    Winchester, UK
    Posts
    535

    Default

    Quote 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.
    Glyn Normington
    SpringSource

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •