当我运行ycsb时,我得到以下错误。我遵循了ycsb git hub link中指定的所有步骤,但是仍然得到了这个错误
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)
我的Zookeeper很好。。。为什么会这样?有人能帮我吗
1条答案
按热度按时间zqdjd7g91#
这是一个依赖性问题。例外情况是它无法找到此方法:
包含该方法的类是静态导入的,因此不会抛出
NoClassDefFoundError
在顶层(您可以看到稍后在堆栈跟踪中抛出),它将抛出NoSuchMethodError
例外。你需要添加
slf4j
jar到你的类路径。