当我运行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)
我的动物园管理员运行得很好...... 为什么会这样?任何人都可以帮助我
答案 0 :(得分:0)
这是一个依赖性问题。例外是告诉你它没有找到这个方法:
org.slf4j.impl.StaticLoggerBinder.getSingleton()Lorg/slf4j/impl/StaticLoggerBinder;
//specifically
getSingleton()
包含该方法的类是静态导入的,因此不会在顶层抛出NoClassDefFoundError
(您可以看到稍后在堆栈跟踪中抛出),它将抛出NoSuchMethodError
异常。
您需要将slf4j
jar添加到类路径中。