- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的本地环境:OSX 10.9.2,java1.6
我使用 java api 连接 hbase 和 maven 来管理我的项目,我将 Hbase-0.94.17 和 Hadoop-core-1.0.4 添加到 pom.xml 中,当我运行我的 .java 程序连接 Hbase 时,我得到了以下错误:
SLF4J: slf4j-api 1.6.x (or later) is incompatible with this binding.
SLF4J: Your binding is version 1.5.5 or earlier.
SLF4J: Upgrade your binding to version 1.6.x.
Exception in thread "main" 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:107)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
at org.apache.zookeeper.ZooKeeper.<clinit>(ZooKeeper.java:94)
at org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper.<init>(RecoverableZooKeeper.java:98)
at org.apache.hadoop.hbase.zookeeper.ZKUtil.connect(ZKUtil.java:127)
at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.<init>(ZooKeeperWatcher.java:153)
at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.<init>(ZooKeeperWatcher.java:127)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getZooKeeperWatcher(HConnectionManager.java:1505)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.ensureZookeeperTrackers(HConnectionManager.java:713)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:983)
at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:958)
at org.apache.hadoop.hbase.client.HTable.finishSetup(HTable.java:251)
at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:155)
at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:129)
at org.geogit.storage.hbase.MyLittleHBaseClient.main(MyLittleHBaseClient.java:29)
这是运行 mvm dependency:tree 后得到的结果
INFO] --- maven-dependency-plugin:2.2:tree (default-cli) @ geogit-hbase ---
[INFO] org.geogit:geogit-hbase:jar:0.8-SNAPSHOT
[INFO] +- org.geogit:geogit-core:jar:0.8-SNAPSHOT:compile
[INFO] | +- org.slf4j:slf4j-api:jar:1.7.5:compile
[INFO] | +- com.vividsolutions:jts:jar:1.13:compile
[INFO] | +- org.geotools:gt-opengis:jar:10.5:compile
[INFO] | | +- net.java.dev.jsr-275:jsr-275:jar:1.0-beta-2:compile
[INFO] | | +- java3d:vecmath:jar:1.3.2:compile
[INFO] | | +- commons-pool:commons-pool:jar:1.5.4:compile
[INFO] | | \- javax.media:jai_core:jar:1.1.3:compile
[INFO] | +- org.geotools:gt-referencing:jar:10.5:compile
[INFO] | | +- org.geotools:gt-metadata:jar:10.5:compile
[INFO] | | \- jgridshift:jgridshift:jar:1.0:compile
[INFO] | +- org.geotools:gt-epsg-hsql:jar:10.5:compile
[INFO] | | \- hsqldb:hsqldb:jar:1.8.0.7:compile
[INFO] | +- org.geotools:gt-main:jar:10.5:compile
[INFO] | | \- org.geotools:gt-api:jar:10.5:compile
[INFO] | +- org.geotools:gt-cql:jar:10.5:compile
[INFO] | +- net.sourceforge.findbugs:jsr305:jar:1.3.7:compile
[INFO] | +- com.google.inject:guice:jar:3.0:compile
[INFO] | | +- javax.inject:javax.inject:jar:1:compile
[INFO] | | \- aopalliance:aopalliance:jar:1.0:compile
[INFO] | +- com.google.inject.extensions:guice-multibindings:jar:3.0:compile
[INFO] | +- com.google.code.gson:gson:jar:2.2.2:compile
[INFO] | \- com.ning:compress-lzf:jar:0.9.8:compile
[INFO] +- org.apache.hbase:hbase-client:jar:0.98.0-hadoop2:compile
[INFO] | +- org.apache.hbase:hbase-common:jar:0.98.0-hadoop2:compile
[INFO] | | +- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] | | \- log4j:log4j:jar:1.2.17:compile
[INFO] | +- org.apache.hbase:hbase-protocol:jar:0.98.0-hadoop2:compile
[INFO] | +- commons-codec:commons-codec:jar:1.7:compile
[INFO] | +- commons-io:commons-io:jar:2.4:compile
[INFO] | +- commons-lang:commons-lang:jar:2.6:compile
[INFO] | +- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] | +- com.google.protobuf:protobuf-java:jar:2.5.0:compile
[INFO] | +- io.netty:netty:jar:3.6.6.Final:compile
[INFO] | +- org.apache.zookeeper:zookeeper:jar:3.4.5:compile
[INFO] | | \- org.slf4j:slf4j-log4j12:jar:1.6.1:compile
[INFO] | +- org.cloudera.htrace:htrace-core:jar:2.04:compile
[INFO] | | \- org.mortbay.jetty:jetty-util:jar:6.1.26:compile
[INFO] | +- org.codehaus.jackson:jackson-mapper-asl:jar:1.8.8:compile
[INFO] | | \- org.codehaus.jackson:jackson-core-asl:jar:1.8.8:compile
[INFO] | +- org.apache.hadoop:hadoop-common:jar:2.2.0:compile
[INFO] | | +- commons-cli:commons-cli:jar:1.2:compile
[INFO] | | +- org.apache.commons:commons-math:jar:2.1:compile
[INFO] | | +- xmlenc:xmlenc:jar:0.52:compile
[INFO] | | +- commons-httpclient:commons-httpclient:jar:3.1:compile
[INFO] | | +- commons-net:commons-net:jar:3.1:compile
[INFO] | | +- org.mortbay.jetty:jetty:jar:6.1.26:compile
[INFO] | | +- com.sun.jersey:jersey-core:jar:1.9:compile
[INFO] | | +- com.sun.jersey:jersey-json:jar:1.9:compile
[INFO] | | | +- org.codehaus.jettison:jettison:jar:1.0.1:compile (version managed from 1.1)
[INFO] | | | | \- stax:stax-api:jar:1.0.1:compile
[INFO] | | | +- com.sun.xml.bind:jaxb-impl:jar:2.2.3-1:compile
[INFO] | | | | \- javax.xml.bind:jaxb-api:jar:2.2.2:compile
[INFO] | | | | \- javax.activation:activation:jar:1.1:compile
[INFO] | | | +- org.codehaus.jackson:jackson-jaxrs:jar:1.8.3:compile
[INFO] | | | \- org.codehaus.jackson:jackson-xc:jar:1.8.3:compile
[INFO] | | +- commons-el:commons-el:jar:1.0:runtime
[INFO] | | +- net.java.dev.jets3t:jets3t:jar:0.6.1:compile
[INFO] | | +- commons-configuration:commons-configuration:jar:1.6:compile
[INFO] | | | +- commons-digester:commons-digester:jar:1.8:compile
[INFO] | | | | \- commons-beanutils:commons-beanutils:jar:1.7.0:compile
[INFO] | | | \- commons-beanutils:commons-beanutils-core:jar:1.8.0:compile
[INFO] | | +- org.apache.avro:avro:jar:1.7.4:compile
[INFO] | | | +- com.thoughtworks.paranamer:paranamer:jar:2.3:compile
[INFO] | | | \- org.xerial.snappy:snappy-java:jar:1.0.4.1:compile
[INFO] | | +- com.jcraft:jsch:jar:0.1.42:compile
[INFO] | | \- org.apache.commons:commons-compress:jar:1.4.1:compile
[INFO] | | \- org.tukaani:xz:jar:1.0:compile
[INFO] | +- org.apache.hadoop:hadoop-auth:jar:2.2.0:compile
[INFO] | +- org.apache.hadoop:hadoop-mapreduce-client-core:jar:2.2.0:compile
[INFO] | | +- org.apache.hadoop:hadoop-yarn-common:jar:2.2.0:compile
[INFO] | | | +- org.apache.hadoop:hadoop-yarn-api:jar:2.2.0:compile
[INFO] | | | +- com.sun.jersey:jersey-server:jar:1.9:compile
[INFO] | | | | \- asm:asm:jar:3.1:compile
[INFO] | | | \- com.sun.jersey.contribs:jersey-guice:jar:1.9:compile
[INFO] | | \- com.google.inject.extensions:guice-servlet:jar:3.0:compile
[INFO] | +- org.apache.hadoop:hadoop-annotations:jar:2.2.0:compile
[INFO] | \- com.github.stephenc.findbugs:findbugs-annotations:jar:1.3.9-1:compile
[INFO] +- org.geogit:geogit-mongodb:jar:0.8-SNAPSHOT:compile
[INFO] | +- org.geogit:geogit-blueprints:jar:0.8-SNAPSHOT:compile
[INFO] | | +- com.tinkerpop.blueprints:blueprints-core:jar:2.4.0:compile
[INFO] | | | +- com.fasterxml.jackson.datatype:jackson-datatype-json-org:jar:2.1.2:compile
[INFO] | | | | +- com.fasterxml.jackson.core:jackson-core:jar:2.1.2:compile
[INFO] | | | | +- com.fasterxml.jackson.core:jackson-databind:jar:2.1.2:compile
[INFO] | | | | | \- com.fasterxml.jackson.core:jackson-annotations:jar:2.1.1:compile
[INFO] | | | | \- org.json:json:jar:20090211:compile
[INFO] | | | \- colt:colt:jar:1.2.0:compile
[INFO] | | | \- concurrent:concurrent:jar:1.3.4:compile
[INFO] | | \- com.tinkerpop.gremlin:gremlin-java:jar:2.4.0:compile
[INFO] | | \- com.tinkerpop:pipes:jar:2.4.0:compile
[INFO] | \- org.mongodb:mongo-java-driver:jar:2.11.3:compile
[INFO] +- com.google.guava:guava:jar:14.0.1:compile
[INFO] +- org.geogit:geogit-core:jar:tests:0.8-SNAPSHOT:test
[INFO] \- junit:junit:jar:4.10:test
[INFO] \- org.hamcrest:hamcrest-core:jar:1.1:test
在这里我附上了我的 pom.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.geogit</groupId>
<artifactId>storage</artifactId>
<version>0.8-SNAPSHOT</version>
</parent>
<groupId>org.geogit</groupId>
<artifactId>geogit-hbase</artifactId>
<packaging>jar</packaging>
<name>HBase Storage for GeoGit objects</name>
<dependencies>
<dependency>
<groupId>org.geogit</groupId>
<artifactId>geogit-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase</artifactId>
<version>0.94.17</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
<version>1.0.4</version>
</dependency>
<!-- is this necessary? -->
<!--
<dependency>
<groupId>com.boundlessgeo</groupId>
<artifactId>blongo</artifactId>
<version>0.1</version>
</dependency>
-->
<!-- is this necessary? -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<!-- Test scope dependencies -->
<dependency>
<groupId>org.geogit</groupId>
<artifactId>geogit-core</artifactId>
<version>${project.version}</version>
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
</profiles>
</project>
最佳答案
拥有slf4j-api
并选择相应版本的SLF4J绑定(bind),并将它们作为依赖项添加到您自己的POM中。很可能您的某些依赖项传递地解决了导致问题的 SLF4J 绑定(bind)的不兼容版本。找出哪个库引入了不需要的 SLF4J 绑定(bind)(您可以通过 mvn dependency:tree
轻松做到这一点),并在您对该库的依赖项中添加相应的排除项。
(正常情况下SLF4J绑定(bind)不应该在库中声明。实际上这是错误的,一旦你找到真正的原因你可能想报告给库开发者)
更新
这正是我要说的:
从你的依赖树:
[INFO] +- org.geogit:geogit-core:jar:0.8-SNAPSHOT:compile
[INFO] | +- org.slf4j:slf4j-api:jar:1.7.5:compile
.....
[INFO] +- org.apache.hbase:hbase-client:jar:0.98.0-hadoop2:compile
.....
[INFO] | +- org.apache.zookeeper:zookeeper:jar:3.4.5:compile
[INFO] | | \- org.slf4j:slf4j-log4j12:jar:1.6.1:compile
您从 hbase-client
获得了 slf4j-log4j12
绑定(bind),这是 1.6.1 版本
但是,您项目中的slf4j-api
是1.7.5 版。它们不兼容。
正确的解决方法是:
hbase-client
的依赖项中排除 slf4j-log4j12
您还应该将此作为错误报告给 zookeeper/hbase 开发人员,因为库不适合将 SLF4J 绑定(bind)作为编译范围依赖项包含在内。
关于java - 线程异常 "main"java.lang.NoSuchMethodError : org. slf4j.impl.StaticLoggerBinder.getSingleton()Lorg/slf4j/impl/StaticLoggerBinder,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22800894/
我尝试使用 slf4j-Logger-Functions 但总是遇到相同的错误: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBin
这个问题在这里已经有了答案: NoSuchMethodError: org.slf4j.impl.StaticLoggerBinder.getSingleton() (4 个答案) 关闭 5 年前。
我的本地环境:OSX 10.9.2,java1.6 我使用 java api 连接 hbase 和 maven 来管理我的项目,我将 Hbase-0.94.17 和 Hadoop-core-1.0
不知道程序有什么问题。我收到这个通知了我已经在 pom.xml 文件上正确设置了依赖项。 SLF4J: Failed to load class "org.slf4j.impl.StaticLogge
我确实有一个像这样的简单类(class): package com.example.howtomocktest import groovy.util.logging.Slf4j import java
当我尝试运行 Hibernate 时,我在控制台中收到以下消息。 SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SL
我正在 GCP 机器中用 Java 实现 apache kafka 流应用程序。我正在使用 kafka 版本 2.12引用网址 - https://kafka.apache.org/22/docume
我有所有必要的依赖: ch.qos.logback logback-classic 1.0.13 org.slf4j slf4j-api 1.7.
我正在构建我的 Maven 项目并部署在 jetty 服务器中,我遇到了这个问题。在我的 ${jetty_home}/lib 中,我有 jcl-over-slf4j-1.7.2.jar、jul-to-
在构建 Maven 项目时,我遇到了一些粘贴在下面的错误 SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J:
我正在尝试运行 here 给出的示例图 block 示例. 下面是我的 POM.xml: junit junit
运行Maven项目时在Eclipse Juno 4.2上出现此错误。 SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
我收到“ 无法加载类”org.slf4j.impl.StaticLoggerBinder “尽管我遵循了规则,但错误: 放置一个(并且只有一个)slf4j-nop.jar、slf4j-simple.j
我的pom.xml仅包含一个对SLF4J的引用: org.slf4j slf4j-jdk14 1.5.10 我收到此错误: SLF4
我的应用程序将部署在 tcServer 和 WebSphere 6.1 上。该应用程序使用 ehCache,因此需要 slf4j 作为依赖项。因此,我将 slf4j-api.jar (1.6) jar
我正在将 spring 应用程序转换为 spring-boot,使用 boot-starter-parent 版本:2.0.4.RELEASE。当我使用 mvn install,它运行良好,但是当我尝
在帖子中找不到解决方案后,我打开了这篇帖子: Failed to load class "org.slf4j.impl.StaticLoggerBinder" error 我还在 IntelliJ 中
我们正在尝试在 Vaadin 项目中初始化 hibernate 数据库,但它会引发以下错误。我们已经寻找了好几天,但到目前为止还没有任何解决方案,我们也没有想法。希望任何人都可以提供帮助。我们正在使用
远程失败:部署期间发生错误:加载应用程序时出现异常:java.lang.IllegalStateException:ContainerBase.addChild:启动:org.apache.catal
这个问题在这里已经有了答案: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" (34 个答案) 关闭 3 年前。 我收
我是一名优秀的程序员,十分优秀!