分享

hadoop-2.6.0-cdh5.9.5编译报错


异常信息:【哪位大神遇到过,如何解决的】
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/RPCUtil.java:[101,10] error: unreported exception Throwable; must be caught or declared to be thrown
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/RPCUtil.java:[104,10] error: unreported exception Throwable; must be caught or declared to be thrown
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/ipc/RPCUtil.java:[107,10] error: unreported exception Throwable; must be caught or declared to be thrown






[mw_shl_code=java,true]  public static Void unwrapAndThrowException(ServiceException se)
      throws IOException, YarnException {
    Throwable cause = se.getCause();
    if (cause == null) {
      // SE generated by the RPC layer itself.
      throw new IOException(se);
    } else {
      if (cause instanceof RemoteException) {
        RemoteException re = (RemoteException) cause;
        Class<?> realClass = null;
        try {
          realClass = Class.forName(re.getClassName());
        } catch (ClassNotFoundException cnf) {
          // Assume this to be a new exception type added to YARN. This isn't
          // absolutely correct since the RPC layer could add an exception as
          // well.
          throw instantiateException(YarnException.class, re);
        }

        if (YarnException.class.isAssignableFrom(realClass)) {
          throw instantiateException(
              realClass.asSubclass(YarnException.class), re);
        } else if (IOException.class.isAssignableFrom(realClass)) {
          throw instantiateException(realClass.asSubclass(IOException.class),
              re);
        } else if (RuntimeException.class.isAssignableFrom(realClass)) {
          throw instantiateException(
              realClass.asSubclass(RuntimeException.class), re);
        } else {
          throw re;
        }
        // RemoteException contains useful information as against the
        // java.lang.reflect exceptions.

      } else if (cause instanceof IOException) {
        // RPC Client exception.
        throw (IOException) cause;
      } else if (cause instanceof RuntimeException) {
        // RPC RuntimeException
        throw (RuntimeException) cause;
      } else {
        // Should not be generated.
        throw new IOException(se);
      }
    }
  }
}[/mw_shl_code]






已有(3)人评论

跳转到指定楼层
nextuser 发表于 2018-5-19 13:33:02
catch(Throwable t) //加上这句
  {
  }

回复

使用道具 举报

一曲离殇 发表于 2018-5-19 17:46:21
nextuser 发表于 2018-5-19 13:33
catch(Throwable t) //加上这句
  {
  }


系统工具包已经安装了这些:autoconf automake libtool gcc gcc-c++ make cmake zlib-devel openssl-devel ncurses-devel
报下面的错误,还缺少什么么


org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (make) on project hadoop-pipes: An Ant BuildException has occured: exec returned: 1
around Ant part ...<exec failonerror="true" dir="/home/wangjw/src/hadoop/hadoop-tools/hadoop-pipes/target/native" executable="cmake">... @ 5:117 in /home/wangjw/src/hadoop/hadoop-tools/hadoop-pipes/target/antrun/build-main.xml

回复

使用道具 举报

一曲离殇 发表于 2018-5-19 18:42:16
一曲离殇 发表于 2018-5-19 17:46
系统工具包已经安装了这些:autoconf automake libtool gcc gcc-c++ make cmake zlib-devel openssl-de ...

这个解决了少装了openssl-devel
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条