My java code to create a Hbase table encounters errors, but the shell works 
well, through it I can create and read tables.

code:
HBaseConfiguration conf = new HBaseConfiguration(); 
HBaseAdmin admin = new HBaseAdmin(conf);


error information as follows
09/10/20 11:24:26 INFO ipc.Client: Retrying connect to server: 
localhost/127.0.0.1:60000. Already tried 0 time(s).
09/10/20 11:24:27 INFO ipc.Client: Retrying connect to server: 
localhost/127.0.0.1:60000. Already tried 1 time(s).
09/10/20 11:24:28 INFO ipc.Client: Retrying connect to server: 
localhost/127.0.0.1:60000. Already tried 2 time(s).
09/10/20 11:24:29 INFO ipc.Client: Retrying connect to server: 
localhost/127.0.0.1:60000. Already tried 3 time(s).
09/10/20 11:24:30 INFO ipc.Client: Retrying connect to server: 
localhost/127.0.0.1:60000. Already tried 4 time(s).
09/10/20 11:24:31 INFO ipc.Client: Retrying connect to server: 
localhost/127.0.0.1:60000. Already tried 5 time(s).
09/10/20 11:24:32 INFO ipc.Client: Retrying connect to server: 
localhost/127.0.0.1:60000. Already tried 6 time(s).
09/10/20 11:24:33 INFO ipc.Client: Retrying connect to server: 
localhost/127.0.0.1:60000. Already tried 7 time(s).
09/10/20 11:24:34 INFO ipc.Client: Retrying connect to server: 
localhost/127.0.0.1:60000. Already tried 8 time(s).
09/10/20 11:24:35 INFO ipc.Client: Retrying connect to server: 
localhost/127.0.0.1:60000. Already tried 9 time(s).
09/10/20 11:24:35 INFO client.HConnectionManager$TableServers: Attempt 0 of 10 
failed with <java.net.ConnectException: Call to localhost/127.0.0.1:60000 
failed on connection exception: java.net.ConnectException: Connection refused>. 
Retrying after sleep of 2000
Exception in thread "main" java.lang.IllegalAccessError: tried to access method 
org.apache.hadoop.ipc.Client.incCount()V from class 
org.apache.hadoop.ipc.HBaseClient
        at org.apache.hadoop.ipc.HBaseClient.incCount(HBaseClient.java:48)
        at 
org.apache.hadoop.hbase.ipc.HbaseRPC$ClientCache.getClient(HbaseRPC.java:187)
        at 
org.apache.hadoop.hbase.ipc.HbaseRPC$ClientCache.access$200(HbaseRPC.java:164)
        at 
org.apache.hadoop.hbase.ipc.HbaseRPC$Invoker.<init>(HbaseRPC.java:238)
        at org.apache.hadoop.hbase.ipc.HbaseRPC.getProxy(HbaseRPC.java:384)
        at org.apache.hadoop.hbase.ipc.HbaseRPC.getProxy(HbaseRPC.java:364)
        at org.apache.hadoop.hbase.ipc.HbaseRPC.getProxy(HbaseRPC.java:412)
        at 
org.apache.hadoop.hbase.client.HConnectionManager$TableServers.getMaster(HConnectionManager.java:188)
        at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:67)
        at Test.createTable(Test.java:24)
        at Test.main(Test.java:103)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:156)

I am confused why it connect localhost:60000, may my hbase configuration be 
right? Would someone can help me solve this problem? Thanks!


Best Wishes!
_____________________________________________________________
 
刘祥龙  Liu Xianglong

Reply via email to