相关疑难解决方法(0)

java.lang.NoSuchFieldError:IBM_JAVA,用于Eclipse中的简单hbase Java客户端

标题是.我的源代码是:

package hbase;

import java.io.IOException;

import org.apache.hadoop.conf.Configuration;
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.hbase.util.Bytes;

public class HbaseExampleClient {
public static void main(String[] args) throws IOException {
    Configuration config = HBaseConfiguration.create();
    config.set("hbase.zookeeper.quorum", "192.168.10.17");
    config.set("hbase.zookeeper.property.clientPort", "2222");
    HBaseAdmin admin = new HBaseAdmin(config);//reports an IBM_JAVA NoSuchFieldError
    HTableDescriptor htd = new HTableDescriptor("test1111");
    HColumnDescriptor hcd = new HColumnDescriptor("data");
    htd.addFamily(hcd);
    admin.createTable(htd);
    byte[] tablename = htd.getName();
    HTableDescriptor[] tables = admin.listTables();
    if(tables.length!= 1 && Bytes.equals(tablename, tables[0].getName()))
    {
        throw new IOException("Failed create of table!");
    }
    admin.close();
} …
Run Code Online (Sandbox Code Playgroud)

java hadoop hbase nosuchfieldexception

1
推荐指数
1
解决办法
7385
查看次数

标签 统计

hadoop ×1

hbase ×1

java ×1

nosuchfieldexception ×1