java.lang.reflect.InvocationTargetException java.lang.NoClassDefFoundError:com / google / common / io / LimitInputStream

时间:2016-01-15 10:00:46

标签: hadoop gradle mapreduce spring-boot yarn

我正在使用hadoop版本2.5.0。
在此行上运行mapreduce作业时获取此异常

boolean b = job.waitForCompletion(true);



 java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: com/google/common/io/LimitInputStream
at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:467)
        at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1295)
        at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1292)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:415)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1642)
        at org.apache.hadoop.mapreduce.Job.submit(Job.java:1292)
        at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1313)

更新
我的问题是hadoop需要从guava16.0中删除的LimitInputStream类,并且是guava14.0。 在添加org.springframework.boot时:spring-boot-gradle-plugin:1.2.7.RELEASE 我收到了这个错误。我该如何解决这个问题

1 个答案:

答案 0 :(得分:1)

你必须强制番石榴版本为14.0

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>14.0</version>
        </dependency>
    </dependencies>
</dependencyManagement>