Hi all,
I meet a problem that I can not connect the HBase using Java API.
The is my simple Java code:
HBaseConfiguration conf=new HBaseConfiguration();
HBaseAdmin admin=new HBaseAdmin(conf);
HTableDescriptor[] tables=admin.listTables();
for (HTableDescriptor table:tables){
System.out.println(Bytes.toString(table.getName()));
}
And I put the hbase-site in classpath. Here is the message:
Exception in thread "IPC Client (47) connection to /10.148.224.11:60020 from
an unknown user" java.lang.NullPointerException
at
org.apache.hadoop.hbase.ipc.HBaseClient$Connection.receiveResponse(HBaseClient.java:518)
at
org.apache.hadoop.hbase.ipc.HBaseClient$Connection.run(HBaseClient.java:448)
But I debug the program and found the exception is happend at line 518 of
file HBaseClient (the bold line):
boolean isError = in.readBoolean(); // read if error
if (isError) {
call.setException(new RemoteException(
WritableUtils.readString(in),
WritableUtils.readString(in)));
} else {
Writable value = ReflectionUtils.newInstance(valueClass, conf);
value.readFields(in); // read value
* call.setValue(value);*
}
Is this a bug or does it need any extra configuration to tell the hbase
cluster who is the client ?
Jeff Zhang