Thanks for the detail Holger.  Helps.

Reading it, it looks like the cluster hasn't started up properly; the NoSuchElementException would seem to indicate that the basic startup deploying the catalog meta tables hasn't happened or has gotten mangled somehow. Whats in your hbase master log file? Do you see successful deploy of the -ROOT- and .META. regions to regionserver?

Are you on local filesystem or HDFS? If latter, because you are on windows, you need to set the hbase.root in hbase-site.xml. See http://wiki.apache.org/lucene-hadoop/Hbase/10Minutes (If you haven't already).

Yours,
St.Ack

Holger Stenzhorn wrote:
Hi,

I checked out Hadoop (including HBase) from its Subversion repository today,
build it successfully (on Cygwin) and started HBase in "local" mode.

Then I took your little example program from the Wiki and it crashes at the
last line:
    HBaseConfiguration conf = new HBaseConfiguration();
    HTableDescriptor desc = new HTableDescriptor("test");
    desc.addFamily(new HColumnDescriptor("content:"));
    HBaseAdmin admin = new HBaseAdmin(conf);
    admin.createTable(desc);

...and I get the following stacktrace:
    java.io.IOException: java.io.IOException:
java.util.NoSuchElementException
        at java.util.TreeMap.key(TreeMap.java:1206)
        at java.util.TreeMap$NavigableSubMap.lastKey(TreeMap.java:1435)
        at
java.util.Collections$SynchronizedSortedMap.lastKey(Collections.java:2125)
        at org.apache.hadoop.hbase.HMaster.createTable(HMaster.java:2460)
        at org.apache.hadoop.hbase.HMaster.createTable(HMaster.java:2424)
        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.ipc.RPC$Server.call(RPC.java:379)
        at org.apache.hadoop.ipc.Server$Handler.run(Server.java:596)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
        at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at
org.apache.hadoop.hbase.RemoteExceptionHandler.decodeRemoteException(RemoteExceptionHandler.java:82)
        at
org.apache.hadoop.hbase.HBaseAdmin.createTableAsync(HBaseAdmin.java:150)
        at
org.apache.hadoop.hbase.HBaseAdmin.createTable(HBaseAdmin.java:119)
        at Test.main(Test.java:19)
After doing a little debugging I found the culprit line in
org.apache.hadoop.hbase.HMaster:
    MetaRegion m = (onlineMetaRegions.containsKey(newRegion.getRegionName())
?
        onlineMetaRegions.get(newRegion.getRegionName()) :
            onlineMetaRegions.get(onlineMetaRegions.headMap(
                newRegion.getTableDesc().getName()).lastKey()));

Looking at that line and its Taking out the single statement
    onlineMetaRegions.containsKey(newRegion.getRegionName()) --> false
    onlineMetaRegions.get(newRegion.getRegionName()) --> null
    newRegion.getTableDesc().getName() --> test
    onlineMetaRegions.headMap(newRegion.getTableDesc().getName()) --> {}
    onlineMetaRegions.headMap(newRegion.getTableDesc().getName()).lastKey()
--> *CRASH*

Does anybody else experience that? ...or is there even a solution for that?

BTW: The same happens when I use the HBase shell... When I type "create
table test (test);" I get the message "java.util.NoSuchElementException"
also.

Cheers,
Holger

Reply via email to