Ask Your Question
0

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(ConfigPusher.java:149) ~[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

Comments

schemaContext.getModules() doesnt have the test module.

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

https://bugs.opendaylight.org/show_bug.cgi?id=1122

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

3 answers

Sort by ยป oldest newest most voted
0

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

Comments

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
0

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">
                <service>
                    <type xmlns:kitchen="urn:opendaylight:params:xml:ns:yang:controller:config:kitchen-service:impl">
                        kitchen:kitchen-service
                    </type>
                    <instance>
                        <name>kitchen-service</name>
                        <provider>/modules/module[type='kitchen-service-impl'][name='kitchen-service-impl']</provider>
                    </instance>
                </service>
            </services>
edit flag offensive delete publish link more

Comments

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

https://bugs.opendaylight.org/show_bug.cgi?id=1122

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

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

Comments

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(ConfigPusherImpl.java:156) at org.opendaylight.controller.netconf.persist.impl.ConfigPusherImpl.pushConfigWithConflictingVersionRetries(ConfigPusherImpl.java:132) at org.opendaylight.controller.netconf.persist.impl.ConfigPusherImpl.internalPushConfigs(ConfigPusherImpl.java:109) at org.opendaylight.controller.netconf.persist.impl.ConfigPusherImpl.process(ConfigPusherImpl.java:76) at org.opendaylight.

Ashwini_Mhatre ( 2014-12-21 22:55:04 -0700 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

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

Seen: 993 times

Last updated: Jun 05 '14