Ask Your Question

Not able to bind the service to MD-SAL at runtime [NotEnoughCapabilitiesException]

asked 2014-05-23 10:40:33 -0700

anu.nair gravatar image

I followed the toaster example exactly ( for the first section, with out RPC) and compiled. The yang model generated the required java files also.

The TestProviderModule::createInstance() is modified to create the AutoclosebaleTest also.

Created a file 04-test-sample.xml in initial for loading the service with the <capability> also as like toaster example.</capability>

While loading the server After loading the ToasterService. Kitchen Service and finally when it loads the TestService, an error was thrown.

capabilities=[urn:opendaylight:params:xml:ns:yang:controller:config:test-provider:impl?module=test-provider-impl&revision=2014-05-22]}. Expected but not found: [urn:opendaylight:params:xml:ns:yang:controller:config:test-provider:impl?module=test-provider-impl&revision=2014-05-22] at org.opendaylight.controller.netconf.persist.impl.ConfigPusher.getOperationService( ~[na:na]

I tried to debug and the exception was thrown from NetconfOperationService getOperationService(..) for my test urn.

NetconfOperationServiceImpl.setupCapabilities( ..) doesn't have my test urn. it got toaster and other classes. { .. yangstoreSnapShot doent have my test module. Set<module> modules = yangStoreSnapshot.getModules(); ..}</module>

Am I missing anything. Any help appreciated.

edit retag flag offensive close merge delete


schemaContext.getModules() doesnt have the test module.

anu.nair ( 2014-05-23 17:49:44 -0700 )edit

anu.nair ( 2014-06-02 18:34:55 -0700 )edit

3 answers

Sort by ยป oldest newest most voted

answered 2014-05-23 11:47:11 -0700

This sounds familiar. I think it's because your test-provider-impl yang is missing at run time. In your pom, for yang-maven-plugin, did you specify the CodeGeneratorImpl in addition to the JXMCodeGenerator? The former is what generates the $YangModelBindingProvider and $YangModuleInfoImpl that are scraped at run time to locate the yang file.

edit flag offensive delete publish link more


Yes I did. <codegenerators> <generator> <codegeneratorclass>org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator</codegeneratorclass> <outputbasedir>${jmxGeneratorPath}</outputbasedir> <additionalconfiguration> <namespacetopackage1>urn:opendaylight:params:xml:ns:yang:controller==org.opendaylight.controller.config.yang</namespacetopackage1> </additionalconfiguration> </generator> <generator> <codegeneratorclass>org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl</codegeneratorclass> <outputbasedir>${salGeneratorPath}</outputbasedir> </generator> </codegenerators>

anu.nair ( 2014-05-23 12:25:08 -0700 )edit

answered 2014-05-26 01:36:46 -0700

michal.rehak gravatar image

Hi Anu, could you check if you exposed the module instance as service? E.g. toaster exposes provider's module as service:

           <services xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
                    <type xmlns:kitchen="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">
edit flag offensive delete publish link more


Thanks for the input. I am not using the module instance as a service. This is my 04-test-sample <snapshot> <configuration> <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config"> <module> <type xmlns:test="urn:opendaylight:params:xml:ns:yang:controller:config:test-provider:impl"> test:test-provider-impl </type> <name>test-provider-impl</name> <data-broker> <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-data-broker</type> <name>binding-data-broker</name> </data-broker> </module> </modules> </data> </configuration> <required-capabilities> <capability>urn:opendaylight:params:xml:ns:yang:controller:config:test-provider:impl?module=test-provider-impl&revision=2014-05-22</capability> </required-capabilities>

anu.nair ( 2014-05-27 09:30:17 -0700 )edit

I am exactly going through the same issue and I have exposed the module instance as service as per Michal Rehak's advice. Like Anu, I was following the step by step procedure, and my provider was ( toaster-provider-2 ). Even after exposing the module instance the binding fails as it cannot find the required capability.

sdoshi ( 2014-05-29 07:40:56 -0700 )edit

Root cause is NetconfOperationServiceImpl::yangstoreSnapShot doent have the module. Set<module> modules = yangStoreSnapshot.getModules(); ..} Not sure how to find / locate the module. Looks like some path issue.

anu.nair ( 2014-05-29 14:17:30 -0700 )edit

anu.nair ( 2014-06-02 18:34:58 -0700 )edit

answered 2014-06-05 17:14:49 -0700

anu.nair gravatar image

The jar file was not there in ~/controller/opendaylight/distribution/opendaylight/target/distribution.opendaylight-osgipackage/opendaylight/plugins

sample-test-provider-1.1-SNAPSHOT.jar sample-test-1.1-SNAPSHOT.jar

I manually copied both my jars to this location and restarted controller.

edit flag offensive delete publish link more


Hi anu, I am getting same error. i have added one new feature in l2 switch .while installing this feature in karaf i am getting following ErrorException in thread "config-pusher" java.lang.IllegalStateException: Max wait for capabilities reached.Not enough capabilities for 59-packetstats.xml(odl-l2switch-packetstats,odl-l2switch-packetstats). Expected but not found: [urn:opendaylight:packet:packet-stats-impl?module=packet-stats-impl&revision=2014-12-10] at org.opendaylight.controller.netconf.persist.impl.ConfigPusherImpl.getOperationServiceWithRetries( at org.opendaylight.controller.netconf.persist.impl.ConfigPusherImpl.pushConfigWithConflictingVersionRetries( at org.opendaylight.controller.netconf.persist.impl.ConfigPusherImpl.internalPushConfigs( at org.opendaylight.controller.netconf.persist.impl.ConfigPusherImpl.process( at org.opendaylight.

Ashwini_Mhatre ( 2014-12-21 22:55:04 -0700 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower


Asked: 2014-05-23 10:40:33 -0700

Seen: 948 times

Last updated: Jun 05 '14