How to register salFlowService, to prevent DOMRpcImplementationNotAvailableException: No implementation of RPC AbsoluteSchemaPath{path=[(urn:opendaylight:flow:service?revision=2013-08-19)add-flow]} available

asked 2015-10-10 08:28:38 -0800

Denis gravatar image

Hi,

I get this error msg in karaf, whenever i try to use the salFlowService in my self developed application, Googling pointed out, that I've to register the salFlowService, to prevent this. But i dont know, how to do this properly in my app. Also, the salFlowService works in l2switch, and I cant see any relevant difference from my code to l2switch/main-impl - code. Also i cannot found there any registering of the salFlowService.

some excerpts of my code (only the relevant parts): FlowBuilderModule - create instance:

   public java.lang.AutoCloseable createInstance() {
       ...
       SalFlowService salFlowService = rpcRegistryDependency
            .getRpcService(SalFlowService.class);
       final FlowBuilder fb = new FlowBuilder(getDataBrokerDependency(), provider);
       fb.setSalFlowService(salFlowService);
       ...
   }

Flowbuilders code:

  public class FlowBuilder {
     ...
     private SalFlowService salFlowService;
     ...


     private void addFlows(List<Flow> flows, NodeConnectorRef destRef) {
        for (Flow f: flows)
           InstanceIdentifier<Flow> flowId = getInstanceIdentifier(flow, destRef);
           AddFlowInput addFlow = new AddFlowInputBuilder(f).setFlowRef(new FlowRef(flowId)).build();
           Future<RpcResult<AddFlowOutput>> futRpc = salFlowService.addFlow(addFlow);
           while (!futRpc.isDone())
              log.debug("flowbuilder: waiting for future rpc");

           if (futRpc.isDone()) {
              try {
                  RpcResult<AddFlowOutput> rpc = futRpc.get();
                  log.debug("flowbuilder: rpc successful : "+rpc.isSuccessful());
            } catch (InterruptedException | ExecutionException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
     }

     private InstanceIdentifer<Flow> getInstanceIdentifier(Flow flow, NodeConnectorRef destRef) {
          return InstanceIdentifier
                .builder(Nodes.class)
                .child(Node.class,
                        new NodeKey(destRef.getValue()
                                .firstKeyOf(Node.class, NodeKey.class)))
                .augmentation(FlowCapableNode.class)
                .child(Table.class, new TableKey((short) 0))
                .child(Flow.class, f.getKey()).build();
     }
  }

yang file - implementation part:

 ...
 augment "/config:modules/config:module/config:configuration" {
 case flowbuilder-impl {
    when "/config:modules/config:module/config:type = 'flowbuilder-impl'";
    ...
     container rpc-registry {
        uses config:service-ref {
          refine type {
            mandatory true;
            config:required-identity mdsal:binding-rpc-registry;
          }
        }
    }
    ...

yang file - config part (48-flowbuilder.xml):

  <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:prefix="urn:opendaylight:medqos:flowbuilder-impl">
        prefix:flowbuilder-impl
               </type>
               <name>flowbuilder-impl</name>
               <notification-service>
                  <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">
                    binding:binding-notification-service
                  </type>
                 <name>binding-notification-broker</name>
               </notification-service>
               <data-broker>
                  <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type>
                  <name>binding-data-broker</name>
               </data-broker>
               <rpc-registry>
                     <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
                   <name>binding-rpc-broker</name>
              </rpc-registry>
       </module>
  </modules>
  </data>
  </configuration>
  <required-capabilities>
      <capability>urn:opendaylight:medqos:flowbuilder-impl?module=flowbuilder-impl&revision=2015-07-09</capability>
   </required-capabilities>
</snapshot>

My application is organized like the l2switch project. Working on Lithium (latest stable/ also tested on built controller from master) In another mailing from your list, i saw that also a possible disconnect of a device can be a factor to raise that exception. But i dont believe this is the point here, as l2switch works. Can anybody point me in the right direction, what I am missing / doing wrong ?

edit retag flag offensive close merge delete

Comments

did you find solution to your problem?

g_trelos ( 2015-11-24 06:18:56 -0800 )edit

any luck for this problem?

mahanare ( 2016-02-18 10:24:01 -0800 )edit

I am not able to import the salFlowService in my App. can you tell me which dependency i should add to my pom to get that SalFlowService ?

karthik330 ( 2016-03-21 01:59:28 -0800 )edit

@g_trelos, mahanare: no but i have to admit, that i stopped working with odl, due its complexity and lack of community support

Denis ( 2016-03-21 09:47:40 -0800 )edit

@karthik330: Not sure about it, but i would guess you look for `<groupid>org.opendaylight.openflowplugin.model</groupid> <artifactid>model-flow-service</artifactid>` At least, there are the impls for salFlowService..

Denis ( 2016-03-21 09:48:08 -0800 )edit