From: Madhu Venugopal Date: Tue, 2 Apr 2013 11:31:43 +0000 (-0700) Subject: OpenDaylight uses Jersey framework to support JAX-RS compliant Northbound API. X-Git-Tag: releasepom-0.1.0~609 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=3259e8de40a02f91eb62eff73078c662914a673c;hp=f7f47649dc420bd56ac0e54557dcbdfc115ae209 OpenDaylight uses Jersey framework to support JAX-RS compliant Northbound API. OSGi makes sure the dependent modules are loaded first and before moving a module into RESOLVED state. But the module implementation can result in one bundle become ACTIVE before the other. This can be resolved properly by having these sequentialized by monitoring the service bringup order. In this case, com.sun.jersey.spi.container expects the jersey-server and core to be active too soon causing the exceptions as seen in Bug 5. But, as per OSGi specification, any bundle can be independently shutdown and restored and the dependent bundles must be robust in handling this. Fortunately, the jersey and dependent framework bundles handles this scenario properly and hence this exception is just informational and has no impact on the running system. OSGi also provides another mechanism called startlevel, which forces some infrastructure bundles to be loaded sooner than the actual dependency is resolved. This accelerates the bundle loading and solves problems like these. But, using this mechanism is discouraged, because a well-made OSGi bundle need not depend on such bundle load parameters for its operation. We are anyways adding this fix as a temporary measure to check the status of the issue in various runtime environments. This fix can be removed after the current work on Apache Valve integration is in place. Change-Id: I2980cc1f79e1d50d457de96b19f3032d8e808609 Signed-off-by: Madhu Venugopal --- diff --git a/opendaylight/distribution/opendaylight/src/assemble/bin.xml b/opendaylight/distribution/opendaylight/src/assemble/bin.xml index 3c163fdd35..96ecf13a81 100644 --- a/opendaylight/distribution/opendaylight/src/assemble/bin.xml +++ b/opendaylight/distribution/opendaylight/src/assemble/bin.xml @@ -53,6 +53,9 @@ org.slf4j:slf4j-api ch.qos.logback:logback-core ch.qos.logback:logback-classic + com.sun.jersey:jersey-core + com.sun.jersey:jersey-json + com.sun.jersey:jersey-server ${artifact.groupId}.${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension} @@ -76,6 +79,10 @@ org.slf4j:slf4j-api ch.qos.logback:logback-core ch.qos.logback:logback-classic + com.sun.jersey:jersey-core + com.sun.jersey:jersey-json + com.sun.jersey:jersey-server + false diff --git a/opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini b/opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini index 3f373e95b7..1b90fc7798 100644 --- a/opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini +++ b/opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini @@ -8,7 +8,10 @@ osgi.bundles=\ reference\:file\:../lib/slf4j-api-1.7.2.jar@1:start,\ reference\:file\:../lib/logback-classic-1.0.9.jar@1:start,\ reference\:file\:../lib/logback-core-1.0.9.jar@1:start,\ - reference\:file\:../lib/logging.bridge-0.4.0-SNAPSHOT@1:start + reference\:file\:../lib/logging.bridge-0.4.0-SNAPSHOT@1:start,\ + reference\:file\:../lib/jersey-core-1.17.jar@2:start,\ + reference\:file\:../lib/jersey-json-1.17.jar@2:start,\ + reference\:file\:../lib/jersey-server-1.17.jar@2:start # Set Default start level for framework osgi.bundles.defaultStartLevel=4