0

当我运行 YCSB 时,我收到以下错误。我遵循了 YCSB git hub 链接中指定的所有步骤,但我仍然收到此错误

Exception in thread "Thread-3" java.lang.NoSuchMethodError: org.slf4j.impl.StaticLoggerBinder.getSingleton()Lorg/slf4j/impl/StaticLoggerBinder;
    at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
    at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
    at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:279)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:252)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:265)
    at org.apache.zookeeper.ZooKeeper.<clinit>(ZooKeeper.java:93)
    at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.<init>(RecoverableZooKeeper.java:92)
    at org.apache.hadoop.hbase.zookeeper.ZKUtil.connect(ZKUtil.java:107)
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.<init>(ZooKeeperWatcher.java:157)
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.<init>(ZooKeeperWatcher.java:131)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getZooKeeperWatcher(HConnectionManager.java:1341)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.ensureZookeeperTrackers(HConnectionManager.java:584)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:846)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:821)
    at org.apache.hadoop.hbase.client.HTable.finishSetup(HTable.java:234)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:174)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:133)
    at com.yahoo.ycsb.db.HBaseClient.getHTable(HBaseClient.java:118)
    at com.yahoo.ycsb.db.HBaseClient.update(HBaseClient.java:302)
    at com.yahoo.ycsb.db.HBaseClient.insert(HBaseClient.java:357)
    at com.yahoo.ycsb.DBWrapper.insert(DBWrapper.java:148)
    at com.yahoo.ycsb.workloads.CoreWorkload.doInsert(CoreWorkload.java:461)
    at com.yahoo.ycsb.ClientThread.run(Client.java:269)
Exception in thread "Thread-1" java.lang.NoClassDefFoundError: Could not initialize class org.apache.zookeeper.ZooKeeper
    at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.<init>(RecoverableZooKeeper.java:92)
    at org.apache.hadoop.hbase.zookeeper.ZKUtil.connect(ZKUtil.java:107)
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.<init>(ZooKeeperWatcher.java:157)
    at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.<init>(ZooKeeperWatcher.java:131)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getZooKeeperWatcher(HConnectionManager.java:1341)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.ensureZookeeperTrackers(HConnectionManager.java:584)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:846)
    at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:821)
    at org.apache.hadoop.hbase.client.HTable.finishSetup(HTable.java:234)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:174)
    at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:133)
    at com.yahoo.ycsb.db.HBaseClient.getHTable(HBaseClient.java:118)
    at com.yahoo.ycsb.db.HBaseClient.update(HBaseClient.java:302)
    at com.yahoo.ycsb.db.HBaseClient.insert(HBaseClient.java:357)
    at com.yahoo.ycsb.DBWrapper.insert(DBWrapper.java:148)
    at com.yahoo.ycsb.workloads.CoreWorkload.doInsert(CoreWorkload.java:461)
    at com.yahoo.ycsb.ClientThread.run(Client.java:269)

我的动物园管理员运行良好......为什么会这样?谁可以帮我这个事

4

1 回答 1

0

这是一个依赖问题。异常告诉您它无法找到此方法:

org.slf4j.impl.StaticLoggerBinder.getSingleton()Lorg/slf4j/impl/StaticLoggerBinder;
//specifically 
getSingleton()

包含该方法的类是静态导入的,因此不会NoClassDefFoundError在顶层抛出 a(您可以在堆栈跟踪中看到稍后抛出),它将抛出NoSuchMethodError异常。

您需要将slf4jjar 添加到类路径中。

于 2013-05-22T08:06:47.800 回答