【问题标题】:Error in compiling hello world example of Opendaylight Fluorine - yang tools issue编译 Opendaylight Fluorine 的 hello world 示例时出错 - yang 工具问题
【发布时间】:2019-05-11 11:12:29
【问题描述】:

我有一个关于 Carbon 版本的 hello-world ODL 项目。我将 POM 依赖项更改为公共存储库中的最新版本,现在我在编译“impl”项目时遇到了错误:

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

这是由于 'api' 项目中的 yang 工具生成的源。源包含“RpcOutput”的导入,但“impl”项目没有找到它。

我将“api”项目中的 POM 更改为 Carbon,它工作正常。

我的“api”项目的 POM 是

<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>

版本 4.0.1 和 3.0.6 失败 - org.opendaylight.mdsal.binding-parent 项目中最新版本的 ODL 和 yang 工具有什么变化?

在简单的“impl”项目中编译失败:

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();
    }
} 

失败并出现“未找到 org.opendaylight.yangtools.yang.binding.RpcOutput 的类文件”错误。

“impl”项目 pom 是

 <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>

主要的pom是

<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>

【问题讨论】:

    标签: opendaylight ietf-netmod-yang


    【解决方案1】:

    你需要使用the appropriate versions for Fluorine:

    • binding-parent0.13.2
    • ODL 父 3.1.6

    您还需要从 config-parent 迁移到 BluePrint,有关详细信息,请参阅 the OpenDaylight wiki BluePrint pageconfig-parent 在 Fluorine 中不再可用。

    既然您要迁移,我建议您直接访问Neon。有详细的guide 帮助您从氟升级到霓虹。

    【讨论】:

    • 谢谢,史蒂夫。我仍然失败。我想这是由于 config-parent 参考。我是否必须从“impl”项目中删除对 config-parent 的“父”引用并使用蓝图。还是在 pom 中添加任何其他参考?是否有新版本的最新原型 - 氟或氮创建蓝图文件
    猜你喜欢
    • 2014-07-19
    • 1970-01-01
    • 2015-08-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-12
    • 1970-01-01
    • 2020-02-08
    相关资源
    最近更新 更多