Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
MapReduce, mail # user - DFSClient throws IncompatibleClassChangeError


Copy link to this message
-
Re: DFSClient throws IncompatibleClassChangeError
Rob Blah 2013-08-21, 08:37
Problem solved.

What I did was forced master POM of my project to use explicitly
guava-11.02 (same as YARN).  Nothing else worked, I even moved the guava-14
to a different location, I removed guava dependency completely from my
project, also didn't worked. Removing guava-14 from my envs didn't worked
as well. Although this might be caused by my development environment.
Anyway if anybody else have a similar problem. The snippet below should
solve your problem.

Master POM:
<dependencies>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>11.0.2</version>
        </dependency>
...
</dependencies>

2013/8/20 Rob Blah <[EMAIL PROTECTED]>

> Hi
>
> When I am trying to use DFSClient it throws the following exception:
> java.lang.IncompatibleClassChangeError: class
> com.google.common.cache.CacheBuilder$3 has interface
> com.google.common.base.Ticker as super class
>     at java.lang.ClassLoader.defineClass1(Native Method)
>     at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
>     at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
>     at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
>     at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
>     at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
>     at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>     at com.google.common.cache.CacheBuilder.<clinit>(CacheBuilder.java:190)
>     at
> org.apache.hadoop.hdfs.DomainSocketFactory.<init>(DomainSocketFactory.java:45)
>     at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:494)
>     at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:449)
>     at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:439)
>     at org.apache.hadoop.hdfs.DFSClient.<init>(DFSClient.java:430)
>     at
> org.my.appMaster.mock.Child_MOCK.initializeLocalData(Child_MOCK.java:75)
>     at org.my.appMaster.mock.Child_MOCK.main(Child_MOCK.java:188)
>
> I am instantiating DFSClient as such:
> DFSClient dfsClient = new DFSClient(new InetSocketAddress(this.NN_Host,
> this.NN_Port), new HdfsConfiguration(true));
>
> NN data is set properly.
>
> I have checked all my export environment variables and the only guava
> version is YARN-dist/share/hadoop/common/lib/guava-11.0.2.jar. Also in the
> runtime classpath (System.getProperty("java.class.path");) only guava-11 is
> present.
>
> Any ideas?
>
> regards
> tmp
>