Support Questions

Find answers, ask questions, and share your expertise

HBase Shell giving error

avatar
Contributor

NoMethodError: undefined method `getTerminal' for Java::Jline::Terminal:Module

refresh_width at /usr/hdp/2.5.0.0-1245/hbase/lib/ruby/shell/formatter.rb:33

initialize at /usr/hdp/2.5.0.0-1245/hbase/lib/ruby/shell/formatter.rb:46

(root) at /usr/hdp/2.5.0.0-1245/hbase/bin/hirb.rb:128

-------------------------------------------------------------------------------

I found it required higher version of protobuf jar so I updated HBase lib by replacing to protobuf-java-3.1.0.jar from protobuf-java-2.5.0.jar, still facing same error.

1 ACCEPTED SOLUTION

avatar
Super Collaborator

Did you make any changes in the hbase classpath or any new jars added to the lib directory? It seems that you have wrong jline there.

View solution in original post

15 REPLIES 15

avatar
Super Collaborator

Did you make any changes in the hbase classpath or any new jars added to the lib directory? It seems that you have wrong jline there.

avatar
Contributor

@ssoldatov

I did not changed hbase classpath, I just replace protobuf jar that I mentioned above

avatar
Super Collaborator

I would suggest to return back the original protobuf (there was a thread about a similar issue somewhere on the internet, but this issue is not relevant to the protobuf). And check that no new jars were added to the HBase lib directory (like phoenix-client for example).

avatar
Contributor

As suggested I return back the original protobuf, but still facing same error. There is no new jar is added in /hbase/lib but we have phoenix, ranger etc jar as I installed all this by Ambari.

avatar
Super Collaborator

Can you run ls -la /usr/hdp/2.5.0.0-1245/hbase/lib/*.jar and attach output here?

avatar
Contributor

@ssoldatov

Thanks...!

In /usr/hdp/current/hbase-master/lib

  1. protobuf-java-3.1.0.jar -> /usr/ibmpacks/current/bigmatch/hbase/lib/protobuf-java-3.1.0.jar
  2. spark-assembly-1.6.2.2.5.0.0-1245-hadoop2.7.3.2.5.0.0-1245.jar -> /usr/ibmpacks/current/bigmatch/hbase/lib/sparkassembly-1.6.2.2.5.0.0-1245-hadoop2.7.3.2.5.0.0-1245.jar

I unlink above two and changed protobuf-java-3.1.0.jar from protobuf-java-2.5.0.jar in /hbase/lib and follow below link.

http://stackoverflow.com/questions/28563167/hbase-master-not-starting-correctly

It worked for me.

avatar

@HARISH BAJPAI

NoMethodError indicates that you are not using the correct version of jar in the classpath.

This is because the "protobuf-java-2.5.0.jar" might be having some classes with different method signature and the newer jar might have different syntax of those methods so you will get errors like you are getting. [NoMethodError: undefined method `getTerminal']

Which means in the newer version of the jar "getTerminal" method seems to be removed.

avatar
Contributor

@jss

In this case what should me next course of action?

avatar

@HARISH BAJPAI

Please do not try to upgrade individual JARs Major Version. Because with every major version change many APIs are changed completely, Like some methods are added new/ some methods are removed and some methods signature is changed. So i will suggest you to not to upgrade the Major version (from 2.5.0 to 3.1.0 ). Please revert back to your old jar "protobuf-java-2.5.0.jar"