Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here. Want to know more about what has changed? Check out the Community News blog.

When doing some tests on hadoop map-reduce on hbase, anyone encountered NetUtils no such method?

When doing some tests on hadoop map-reduce on hbase, anyone encountered NetUtils no such method?

New Contributor

Hi,

 

We're currently running some tests regarding the use of HBase with hadoop map-red jobs and encountering the following errors when connecting to local hbase for our tests.

Environment is standard edition CDH 4.3 and using the hbase-0.94.6-cdh4.3.0.jar in our Java program.

 

...

14/03/11 16:37:08 INFO zookeeper.ClientCnxn: Opening socket connection to server...

14/03/11 16:37:08 INFO zookeeper.ClientCnxn: Socket connection established..

14/03/11 16:37:08 INFO zookeeper.ClientCnxn: Session establishment complete on server...

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.hadoop.net.NetUtils.getInputStream(Ljava/net/Socket;)Ljava/io/InputStream;
    at org.apache.hadoop.hbase.ipc.HBaseClient$Connection.setupIOstreams(HBaseClient.java:437)
    at org.apache.hadoop.hbase.ipc.HBaseClient.getConnection(HBaseClient.java:1124)
    at org.apache.hadoop.hbase.ipc.HBaseClient.call(HBaseClient.java:974)
    at org.apache.hadoop.hbase.ipc.WritableRpcEngine$Invoker.invoke(WritableRpcEngine.java:86)
    at $Proxy7.getProtocolVersion(Unknown Source)
    at org.apache.hadoop.hbase.ipc.WritableRpcEngine.getProxy(WritableRpcEngine.java:138)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getMaster(HConnectionManager.java:712)
    at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:126)
    at HbaseClient.<init>(HbaseClient.java:29)

Any information/feedback will be much appreciated.

 

Thanks,

 

Mark dg

4 REPLIES 4

Re: When doing some tests on hadoop map-reduce on hbase, anyone encountered NetUtils no such method?

New Contributor
solved the problem, hbase jar file needs to be set in hadoop-env.sh

Re: When doing some tests on hadoop map-reduce on hbase, anyone encountered NetUtils no such method?

New Contributor

am getting the same error. may i know what changes you did clearly. it will help

Re: When doing some tests on hadoop map-reduce on hbase, anyone encountered NetUtils no such method?

New Contributor
am getting the same error. may i know what changes you did clearly. it will help

Re: When doing some tests on hadoop map-reduce on hbase, anyone encountered NetUtils no such method?

Champion

@mark dg @gops

 

In java when ever you come across this below exception 

"Exception in thread "main" java.lang.NoSuchMethodError:  " 

it denotest that the method that you are invoking is no where to be found in any class meaning there is no jars pertain to that class / method in the class path were you are runining the java code . 

 

so the fix is to find the approrpriate jar file and add that jar file to the hadoop class path and give the nesseasry permission to it , meaning . 

 

in his case he solved by adding the hbase.jar file to class path by adding entry to the hadoop-env.sh 

which in this location  by default  -  /etc/hadoop/hadoop-env.sh