当我使用hbase java客户机时,出现了一个错误
org.apache.thrift.protocol.TProtocolException: Missing version in readMessageBegin, old client?
at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:213)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:69)
at org.apache.hadoop.hbase.thrift.generated.Hbase$Client.recv_getTableNames(Hbase.java:867)
at org.apache.hadoop.hbase.thrift.generated.Hbase$Client.getTableNames(Hbase.java:855)
at org.HBaseJDBC.HBaseClient.main(HBaseClient.java:61)
下面是我的java代码,
TTransport socket = new TSocket("192.168.1.80", 60000);// IP Host Name
TProtocol protocol = new TBinaryProtocol(socket, true, true);// Note here
Hbase.Client client = new Hbase.Client(protocol);
socket.open();
try {
for (ByteBuffer name : client.getTableNames()) {
//code
}
} catch (Exception e) {
e.printStackTrace();
System.out.println(e.getMessage());
}
这里我的hbase运行在hortonworks沙盒虚拟机上,java客户机运行在本地主机上。为什么我会出现这个错误?我使用的是hbase server 0.98.4版本。
暂无答案!
目前还没有任何答案,快来回答吧!