问题
I am trying to implement an OpenDaylight bundle that receives notifications when flows change. Therefore, I implemented DataTreeChangeListener<Flow>
. The project compiles and starts (./karaf/target/assembly/bin/karaf
), but when I install additional package (feature:install odl-restconf odl-l2switch-switch odl-dluxapps-yangvisualizer odl-dluxapps-yangman odl-dlux-core odl-dluxapps-nodes odl-dluxapps-topology odl-mdsal-apidocs
), I get the following error:
Unsatisfied Requirements:
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.netconf.sal.rest.api)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.netconf.sal.restconf.api)"
Unsatisfied Requirements:
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.codecs)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.handlers)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.jersey.providers)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.jersey.providers.api)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.jersey.providers.patch)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.jersey.providers.schema)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.jersey.providers.spi)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.references)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.rests.services.api)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.rests.transactions)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.services.simple.api)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.streams.listeners)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.streams.websockets)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.utils)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.utils.mapping)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.utils.parser)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.utils.parser.builder)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.utils.validations)"
Error executing command: Error restarting bundles:
Could not resolve module: org.opendaylight.netconf.restconf-nb-bierman02 [318]
Bundle was not resolved because of a uses contraint violation.
org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource org.opendaylight.netconf.restconf-nb-bierman02 [osgi.identity; osgi.identity="org.opendaylight.netconf.restconf-nb-bierman02"; type="osgi.bundle"; version:Version="1.7.0.SNAPSHOT"] because it is exposed to package 'javax.annotation' from resources javax.annotation-api [osgi.identity; osgi.identity="javax.annotation-api"; type="osgi.bundle"; version:Version="1.2.0"] and org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.11.3.v20170209-1843"; singleton:="true"] via two dependency chains.
Chain 1:
org.opendaylight.netconf.restconf-nb-bierman02 [osgi.identity; osgi.identity="org.opendaylight.netconf.restconf-nb-bierman02"; type="osgi.bundle"; version:Version="1.7.0.SNAPSHOT"]
import: (osgi.wiring.package=javax.annotation)
|
export: osgi.wiring.package: javax.annotation
javax.annotation-api [osgi.identity; osgi.identity="javax.annotation-api"; type="osgi.bundle"; version:Version="1.2.0"]
Chain 2:
org.opendaylight.netconf.restconf-nb-bierman02 [osgi.identity; osgi.identity="org.opendaylight.netconf.restconf-nb-bierman02"; type="osgi.bundle"; version:Version="1.7.0.SNAPSHOT"]
import: (&(osgi.wiring.package=com.google.common.base)(&(version>=23.3.0)(!(version>=24.0.0))))
|
export: osgi.wiring.package=com.google.common.base; uses:=javax.annotation
com.google.guava [osgi.identity; osgi.identity="com.google.guava"; type="osgi.bundle"; version:Version="23.3.0.jre"]
import: (osgi.wiring.package=javax.annotation)
|
export: osgi.wiring.package: javax.annotation
org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.11.3.v20170209-1843"; singleton:="true"]
Could not resolve module: org.opendaylight.netconf.restconf-nb-rfc8040 [319]
Bundle was not resolved because of a uses contraint violation.
org.osgi.service.resolver.ResolutionException: Uses constraint violation. Unable to resolve resource org.opendaylight.netconf.restconf-nb-rfc8040 [osgi.identity; osgi.identity="org.opendaylight.netconf.restconf-nb-rfc8040"; type="osgi.bundle"; version:Version="1.7.0.SNAPSHOT"] because it is exposed to package 'javax.annotation' from resources javax.annotation-api [osgi.identity; osgi.identity="javax.annotation-api"; type="osgi.bundle"; version:Version="1.2.0"] and org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.11.3.v20170209-1843"; singleton:="true"] via two dependency chains.
Chain 1:
org.opendaylight.netconf.restconf-nb-rfc8040 [osgi.identity; osgi.identity="org.opendaylight.netconf.restconf-nb-rfc8040"; type="osgi.bundle"; version:Version="1.7.0.SNAPSHOT"]
import: (osgi.wiring.package=javax.annotation)
|
export: osgi.wiring.package: javax.annotation
javax.annotation-api [osgi.identity; osgi.identity="javax.annotation-api"; type="osgi.bundle"; version:Version="1.2.0"]
Chain 2:
org.opendaylight.netconf.restconf-nb-rfc8040 [osgi.identity; osgi.identity="org.opendaylight.netconf.restconf-nb-rfc8040"; type="osgi.bundle"; version:Version="1.7.0.SNAPSHOT"]
import: (&(osgi.wiring.package=com.google.common.base)(&(version>=23.3.0)(!(version>=24.0.0))))
|
export: osgi.wiring.package=com.google.common.base; uses:=javax.annotation
com.google.guava [osgi.identity; osgi.identity="com.google.guava"; type="osgi.bundle"; version:Version="23.3.0.jre"]
import: (osgi.wiring.package=javax.annotation)
|
export: osgi.wiring.package: javax.annotation
org.eclipse.osgi [osgi.identity; osgi.identity="org.eclipse.osgi"; type="osgi.bundle"; version:Version="3.11.3.v20170209-1843"; singleton:="true"]
karaf@root()> Unsatisfied Requirements:
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.netconf.sal.rest.api)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.netconf.sal.restconf.api)"
Unsatisfied Requirements:
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.codecs)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.handlers)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.jersey.providers)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.jersey.providers.api)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.jersey.providers.patch)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.jersey.providers.schema)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.jersey.providers.spi)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.references)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.rests.services.api)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.rests.transactions)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.services.simple.api)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.streams.listeners)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.streams.websockets)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.utils)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.utils.mapping)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.utils.parser)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.utils.parser.builder)"
osgi.wiring.package; filter:="(osgi.wiring.package=org.opendaylight.restconf.nb.rfc8040.utils.validations)"
What am I missing? The complete code is available at Github
Thanks in advance! Max
回答1:
If you are seeing this on the latest ODL (Oxygen), then this is the same problem that recently sometimes surfaced on OpenDaylight's integration build as well... we are now tracking this in https://jira.opendaylight.org/browse/NETCONF-516.
We are hoping that merge of https://git.opendaylight.org/gerrit/#/c/68255/ will fix this in the short term, also https://git.opendaylight.org/gerrit/#/c/67184/ should help in the longer term (when projects bump to new odlparent); you could also try https://git.opendaylight.org/gerrit/#/c/68199/ although that was found not to help.
来源:https://stackoverflow.com/questions/48976008/opendaylight-listen-for-flow-updates