当我使用我的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版本。