java.lang.IllegalAccessError: tried to access method com.google.common.base.Stopwatch.()V

java.lang.IllegalAccessError: tried to access method com.google.common.base.Stopwatch.()V from class org.apache.hadoop.mapred.FileInputFormat
	at org.apache.hadoop.mapred.FileInputFormat.getSplits(FileInputFormat.java:312)
	at org.apache.hadoop.mapred.lib.DelegatingInputFormat.getSplits(DelegatingInputFormat.java:107)
	at org.apache.hadoop.mapreduce.JobSubmitter.writeOldSplits(JobSubmitter.java:624)
	at org.apache.hadoop.mapreduce.JobSubmitter.writeSplits(JobSubmitter.java:616)
	at org.apache.hadoop.mapreduce.JobSubmitter.submitJobInternal(JobSubmitter.java:492)
	at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1296)
	at org.apache.hadoop.mapreduce.Job$10.run(Job.java:1293)
	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:1628)
	at org.apache.hadoop.mapreduce.Job.submit(Job.java:1293)
	at org.apache.hadoop.mapred.JobClient$1.run(JobClient.java:562)
	at org.apache.hadoop.mapred.JobClient$1.run(JobClient.java:557)
	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:1628)
	at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:557)
	at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:548)

做了几个测试,其他版本不变,hadoop.version 为 2.4.0,2.4.1,2.5.2,2.6.1,2.6.4 都会报上面的错误,不知道是不是hadoop的bug,有人说将hadoop的源码重新编译一下就行,但我没试。

解决办法:
把hadoop version改成2.2.0就可以了,测了一下2.7.2也可以,所以估计是hadoop的一个坑,2.7.2就修复了。其他版本没试

 

http://blog.csdn.net/blackweekend/article/details/51719385

Leave a Reply

Your email address will not be published. Required fields are marked *