Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

hbase java Exception in thread "main" java.lang.IllegalArgumentException: Not a host:port pair: PBUF

avatar
Frequent Visitor

Hi...


while trying to execute the execute the below java code , I was getting the error (mentioned below)
Can anyone help me to resolve the issue..
thanks in advance


import java.io.IOException;

import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.conf.Configuration;

public class CreateTable {

public static void main(String[] args) throws IOException {

// Instantiating configuration class
Configuration con = HBaseConfiguration.create();

// Instantiating HbaseAdmin class
HBaseAdmin admin = new HBaseAdmin(con);

// Instantiating table descriptor class
HTableDescriptor tableDescriptor = new HTableDescriptor("emp");

// Adding column families to table descriptor
tableDescriptor.addFamily(new HColumnDescriptor("personal"));
tableDescriptor.addFamily(new HColumnDescriptor("professional"));

// Execute the table through admin
admin.createTable(tableDescriptor);
System.out.println(" Table created ");
}
}

 

 error:


16/06/09 21:03:44 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2181 sessionTimeout=180000 watcher=hconnection
16/06/09 21:03:44 INFO zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181
16/06/09 21:03:44 INFO zookeeper.RecoverableZooKeeper: The identifier of this process is 16738@quickstart.cloudera
16/06/09 21:03:44 INFO zookeeper.ClientCnxn: Socket connection established to localhost/127.0.0.1:2181, initiating session
16/06/09 21:03:44 INFO zookeeper.ClientCnxn: Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x15530ed899d002f, negotiated timeout = 40000


Exception in thread "main" java.lang.IllegalArgumentException: Not a host:port pair: PBUF

quickstart.cloudera���ȴ��*

1 ACCEPTED SOLUTION

avatar
Mentor
You are using a very old hbase library version jar in your code/build.
Please use the same version as the cluster, and I'd also recommend using
maven to fetch those dependencies.

View solution in original post

1 REPLY 1

avatar
Mentor
You are using a very old hbase library version jar in your code/build.
Please use the same version as the cluster, and I'd also recommend using
maven to fetch those dependencies.