Dhopu K
Dhopu K

Reputation: 5

Error in compiling hello world example of Opendaylight Fluorine - yang tools issue

I had a working hello-world ODL project on Carbon release. I changed the POM dependencies to the latest version from the public repository and now I am getting a failure while compiling the 'impl' project:

cannot access org.opendaylight.yangtools.yang.binding.RpcOutput
[ERROR]   class file for org.opendaylight.yangtools.yang.binding.RpcOutput not found

This is due to the source generated by the yang tools in the 'api' project. The sources contain imports of 'RpcOutput' but the 'impl' project does not find it.

I changed my POM in the 'api' project to Carbon and it works fine.

My POM for 'api' project is

<parent>
    <groupId>org.opendaylight.mdsal</groupId>
    <artifactId>binding-parent</artifactId>
    <!--<version>0.10.4-Carbon</version>--> <--this works-->
    <version>4.0.1</version>  <--this fails-->
    <relativePath/>
  </parent>

Versions 4.0.1 and 3.0.6 fail - what has changed in the latest version of ODL and yang tools from the org.opendaylight.mdsal.binding-parent project?

The compilation fails in the 'impl' project which is simple:

public class HelloWorldImpl implements HelloService{

    @Override
    public ListenableFuture<RpcResult<HelloWorldOutput>> helloWorld(HelloWorldInput input) {
        HelloWorldOutputBuilder hout = new HelloWorldOutputBuilder();
        hout.setGreeting("hello" + input.getName());
        return RpcResultBuilder.success(hout.build()).buildFuture();
    }
} 

It fails with the "class file for org.opendaylight.yangtools.yang.binding.RpcOutput not found" error.

The 'impl' project pom is

 <parent>
  <groupId>org.opendaylight.controller</groupId>
  <artifactId>config-parent</artifactId>
  <!--<version>0.6.4-Carbon</version>--><!--this was the old working--> 
  <version>0.8.4</version>  <!--this is also the latest ver-->
  <relativePath/>
 </parent>

The main pom is

<parent>
   <groupId>org.opendaylight.odlparent</groupId>
   <artifactId>odlparent</artifactId>
   <!--<version>1.8.4-Carbon</version>--><!--this was old working ver-->
   <version>5.0.0</version> <!--this is also the latest ver-->
   <relativePath/>
  </parent>

Upvotes: 0

Views: 188

Answers (1)

Stephen Kitt
Stephen Kitt

Reputation: 2881

You need to use the appropriate versions for Fluorine:

  • binding-parent 0.13.2
  • ODL Parent 3.1.6

You’ll also need to migrate from config-parent to BluePrint, see the OpenDaylight wiki BluePrint page for details. config-parent is no longer available in Fluorine.

Since you’re migrating anyway, I would recommend going straight to Neon. There’s a detailed guide to help you upgrade from Fluorine to Neon.

Upvotes: 1

Related Questions