Java SLF4J:未能加载“类”;org.slf4j.impl.StaticLoggerBinder”的;使用Jdbc连接到配置单元时
我正在尝试使用jdbc连接到hive,程序发现: } 我将Java SLF4J:未能加载“类”;org.slf4j.impl.StaticLoggerBinder”的;使用Jdbc连接到配置单元时,java,hive,Java,Hive,我正在尝试使用jdbc连接到hive,程序发现: } 我将hive2更改为hive,并将驱动程序名称从org.apache.hive.jdbc.HiveDriver更改为org.apache.hadoop.hive.jdbc.HiveDriver 现在我得到以下错误: Before getting connection SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-
hive2
更改为hive
,并将驱动程序名称从org.apache.hive.jdbc.HiveDriver
更改为org.apache.hadoop.hive.jdbc.HiveDriver
现在我得到以下错误:
Before getting connection
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
我的类路径中有以下jar
:
hive-common-0.8.1
hive-metastore-0.8.1
hive-service-0.8.1
httpclient-4.3.3
httpcore-4.2.1
httpmime-4.3
libfb303-0.9.0
libthrift-0.9.0
hive-exec-0.8.1
hive-jdbc-0.10.0
slf4j.api-1.6.1
在类路径中还需要一个SLF4J实现。根据要使用的日志记录系统,有几个选项。选择的日志系统本身也必须添加,除非它内置到JRE中 如果不需要高级日志记录功能,一种简单的方法是添加
slf4j simple
查看以了解更多详细信息。我将slf4j-simple-1.6.1 jar添加到类路径中,现在没有错误,但程序被卡住了。这可能是另一个值得思考的问题。你看到程序的一些输出了吗?只有这个显示出来:在连接OK之前,这个地址似乎没有应答。网络或防火墙问题?如果您等待的时间足够长,是否会出现超时异常?我没有收到任何异常
hive-common-0.8.1
hive-metastore-0.8.1
hive-service-0.8.1
httpclient-4.3.3
httpcore-4.2.1
httpmime-4.3
libfb303-0.9.0
libthrift-0.9.0
hive-exec-0.8.1
hive-jdbc-0.10.0
slf4j.api-1.6.1