Hive 查询报错:No log4j2 configuration file found. Using default configuration: logging only errors to th

java程序如何打包为jar,以及避免log4j2在打包后出现异常 问题描述 将使用log4j2的程序打包后出现如下异常: ERROR StatusLogger Unrecognized format specifier [d] ERROR StatusLogger Unrecognized conversion specifier [d] starting at position 16 in conversion pattern. ERROR StatusLogger Unrecognized format specifier [thread] ERROR StatusL 阅读详情

在JDBC连接hive2查询时报错:


[root@localhost test]# java -jar HiveQueryTest.jar
ERROR StatusLogger Unrecognized format specifier [d]
ERROR StatusLogger Unrecognized conversion specifier [d] starting at position 16 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [thread]
ERROR StatusLogger Unrecognized conversion specifier [thread] starting at position 25 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [level]
ERROR StatusLogger Unrecognized conversion specifier [level] starting at position 35 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [logger]
ERROR StatusLogger Unrecognized conversion specifier [logger] starting at position 47 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [msg]
ERROR StatusLogger Unrecognized conversion specifier [msg] starting at position 54 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [n]
ERROR StatusLogger Unrecognized conversion specifier [n] starting at position 56 in conversion pattern.
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
ERROR StatusLogger Unrecognized format specifier [d]
ERROR StatusLogger Unrecognized conversion specifier [d] starting at position 16 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [thread]
ERROR StatusLogger Unrecognized conversion specifier [thread] starting at position 25 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [level]
ERROR StatusLogger Unrecognized conversion specifier [level] starting at position 35 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [logger]
ERROR StatusLogger Unrecognized conversion specifier [logger] starting at position 47 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [msg]
ERROR StatusLogger Unrecognized conversion specifier [msg] starting at position 54 in conversion pattern.
ERROR StatusLogger Unrecognized format specifier [n]
ERROR StatusLogger Unrecognized conversion specifier [n] starting at position 56 in conversion pattern.

网上搜了下, 说缺少log4j2.xml 配置

将log4j2.xml 配置放在src下

<?xml version="1.0" encoding="UTF-8"?>

<Configuration status="OFF">
	<Appenders>
		<Console name="Console" target="SYSTEM_OUT">
			<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
		</Console>
	</Appenders>
	<Loggers>
		<Logger name="hive.server2.query.ApiQueryTest" level="trace">
			<AppenderRef ref="Console" />
		</Logger>
		<Logger name="hive.server2.query" level="debug">
			<AppenderRef ref="Console" />
		</Logger>
		<Root level="error">
			<AppenderRef ref="Console" />
		</Root>
	</Loggers>
</Configuration>

结果还是报错, 所找不到: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
网上搜了下, 所缺少xerces相关jar包

下载 http://xerces.apache.org/mirrors.cgi

加入 Referenced Libraries , 运行OK

【异常】ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the 缺少了一个log4j-core.jar的日志核心包。引入log4j-core即可。 阅读详情

相关推荐

用LT1166+MOS管打造实验室级恒流源:闭环反馈与推挽驱动的深度调优

本文详细介绍了基于LT1166电流模式控制器与MOS管推挽架构的实验室级恒流源设计方法。通过闭环反馈调优和动态响应优化,实现带宽达100kHz、纹波低于0.1%的高性能恒流输出,适用于精密仪器校准和半导体测试等场景。重点解析了系统架构设计、MOS管选型策略以及频率响应测试等关键技术要点。

weixin_29290379的博客 207

Log4j2报错ERROR StatusLogger Unrecognized format specifier

目录 问题 解决方法 原因分析 问题 使用maven-shade-plugin或者maven-assembly-plugin插件把项目打成一个可执行JAR包时,如果你引入了log4j2会出现如下问题 ERROR StatusLogger Unrecognized format specifier [d] ERROR StatusLogger Unrecognized conversion specifier [d] starting at position 16 in conversion p

5227

手机耳机麦克风(ECM)电路设计实战:从差分走线到射频干扰滤波,一个电阻引发的灵敏度问题

本文深入探讨了手机耳机麦克风(ECM)电路设计中的关键问题,从差分走线到射频干扰滤波,特别关注了一个电阻引发的灵敏度问题。通过实际案例分析,详细解析了ECM麦克风工作原理、偏置电阻选型、差分信号传输设计以及射频干扰抑制策略,为工程师提供了实用的设计指南和优化建议。

weixin_42563415的博客 244

Log4j2 升级到2.17.1踩过的坑

目录 1. 如果你用的是spring boot2.x 怎么升级方便 2.Caused by: java.lang.NoSuchMethodError: com.lmax.disruptor.dsl.Disruptor 3. Log4j2 error-ERROR StatusLogger Unrecognized format specifier 版本 Library Current Upgraded Lo4j2 related jar * 2.17.1 ..

Harry的博客 8552

Pinocchio 安装教程|机器人学的必备库

安装pinocchio,不要安装pip3 install pinocchio!

darcsdn 1662

56、Cortex - M33处理器浮点单元(FPU)的使用与优化

本文详细介绍了Cortex-M33处理器浮点单元(FPU)的使用与优化方法,涵盖单双精度浮点计算的选择、编译器命令行配置、ABI模式对比、特殊FPU模式设置(如Flush-to-Zero、Default NaN)、浮点异常处理机制以及FPU电源管理策略。结合代码示例和流程图,提供了在不同应用场景下的最佳实践建议,并总结了常见问题及解决方案,帮助开发者提升嵌入式系统中浮点运算的性能、精度与能效。

bread的博客 155

2018-12-18-log4j-log4j2打包后找不到日志配置文件

在项目里面跑的好好的log4j2,使用maven打成jar包后就报错找不到log4j2的配置文件。错误如下: java -jar ytsafe-console-1.0-SNAPSHOT.jar ERROR StatusLogger Unrecognized format specifier [d] ERROR StatusLogger Unrecognized conversion specif...

小肥的胖 4973

什么是 SAP S/4HANA 的 VDM Layering Architecture 的 CDS Hierarchy View

当涉及SAP S/4HANA的CDS Hierarchy View时,我们正在谈论一种高级数据建模技术,用于构建层次结构化的数据视图,以支持树状和分层数据的处理和分析。CDS(Core Data Services)是SAP的一种数据建模和定义语言,而CDS Hierarchy View则是CDS的一个重要组成部分,用于处理层次数据,如组织结构、产品分类、地理区域等。首先,您可以使用CDS语言创建一个新的CDS Hierarchy View,定义产品分类的层次结构。您还可以定义其他与库存相关的属性。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 392

log4j2 ERROR StatusLogger Unrecognized conversion specifier解决

这个问题时使用自定义log4j2 transformers的时候,在使用shadow进行构建jir包后,如果出现og4j2 ERROR StatusLogger Unrecognized conversion specifier这样的错,此时需要在gradle中加入transform: import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer // Create a

Timmer的博客 2098

数学建模学习(78):多输入多输出回归预测模型(结合XGBoost实现)

多输入多输出回归预测问题求解

全栈川川 8131

手把手教你学simulink(31.17)--双向DCDC电源场景示例:基于simulink 的双向DCDC应用:车载充电器的pi控制

通过引入PI控制器,系统可以更精确地控制电压和电流,确保充电和放电过程的稳定性和高效性。

MHD0815的博客 205

使用log4j2的jar包报错:ERROR StatusLogger Unrecognized conversion specifier [d]

执行jar包上次遇到过一个问题,这次又出现一个,同样是idea执行没问题,达成jar包运行jar包出现问题 log4j2 是采用的插件式编程,当log4j2包编译时,或者含有log4j2插件的包编译时,会将需要加载的插件信息放在META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat这个文件中(包括官方logj42的原生插件),然后项目启动的时候,log4j2会在各个jar包的META-INF目录下扫描这个插件信息文件,然

5573

一般无穷积分的收敛判别法

文章目录积分里的狄屎判别法证明阿贝尔判别法总结补充:级数中的狄屎和Abel 积分里的狄屎判别法 F(u)=∫auf(x)dx在[a,+∞)F(u)=\int_a^uf(x)dx在[a,+\infty)F(u)=∫au​f(x)dx在[a,+∞)有界 x→+∞时,g(x)单减→0x\to+\infty时,g(x)单减\rightarrow0x→+∞时,g(x)单减→0 ⇒\Rightarrow⇒ ...

universe_1207的博客 1万+

Log4j2报错ERROR StatusLogger Unrecognized解决方法

代码】Log4j2报错ERROR StatusLogger Unrecognized解决方法。

on the way . . . 2943

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

Spring boot升级到2.3.2.Release和Spring framework升级到5.28.Release踩过的坑

版本 Library Current Upgraded Spring Boot 1.5.19.RELEASE 2.3.2.RELEASE Spring Framework 4.3.22.RELEASE 5.2.8.RELEASE 1. 利用下面方法启动spring boot 项目是系统参数不生效 [02:15:30][Step 2/2] The system property 'syst1' must be defined 相关命令 mvn spri

Harry的博客 5519

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

jar包中使用log4j2不起作用

某程序中有使用到log4j2,将该程序打包成jar,使用以下命令执行时,发现log4j不输出 java -cp Tool.jar com.zhen.nameOnce.Log4jTest 且报以下错误 ERROR StatusLogger Unrecognized format specifier [d] ERROR StatusLogger Unrecognized conve...

weixin_30246221的博客 565

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

问题排查记录-多个jar包之间Log4j2冲突问题

问题描述: 当存运行环境中,多个jar同时依赖Log4j2会发生冲突,报错如下 ERROR StatusLogger Unrecognized format specifier [d] ERROR StatusLogger Unrecognized conversion specifier [d] starting at position 16 in conversion pattern. ERROR StatusLogger Unrecognized format specifier [thread] E

u011926899的专栏 2809

log4j2项目打成jar包运行日志无法打印

maven项目中因为引入的有log4j2 在打成jar包 通过java -cp 命令运行时,引起下面这段错误,后果就是log日志无法打印。 ERROR StatusLogger Unrecognized format specifier [d] ERROR StatusLogger Unrecognized conversion specifier [d] starting at position...

qq_37489565的博客 4787

ERROR StatusLogger No Log4j 2 configuration file found. Using default configuration (logging only er

错误:ERROR StatusLogger No Log4j 2 configuration file found. Using default configuration (logging only errors to the console), or user programmatically provided configurations. Set system property 'log4j2.debug' to show Log4j 2 internal initialization loggin

qq_40853933的博客 8492

含有log4j2项目打成jar包运行日志无法打印

maven项目中因为引入的有log4j2 在打成jar包 通过java -cp 命令运行时,引起下面这段错误,后果就是log日志无法打印。 ERROR StatusLogger Unrecognized format specifier [d] ERROR StatusLogger Unrecognized conversion specifier [d] starting at positi...

dingyufei的博客 4462

log4j2配置文件log4j2.xml

原地址:https://www.cnblogs.com/hafiz/p/6170702.html 1.关于配置文件的名称以及在项目中的存放位置     log4j 2.x版本不再支持像1.x中的.properties后缀的文件配置方式,2.x版本配置文件后缀名只能为".xml",".json"或者".jsn".     系统选择配置文件的优先级(从先到后)如下:       (1).classpa...

weixin_34306593的博客 71

Log4j & Log4j2~从入门到入坑。

Log4j & Log4j2~从入门到入坑。

lyfGeek的博客 229

Jmeter 打开遇到问题

Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002 解决办法(windows 7) 打开注册表  在HKEY_LOCAL_MACHINE\Software\JavaSoft下新建Prefs项

candyAni 1276

Maven下打包成fatjar出现Invalid signature file digest for Manifest main attributes问题解决

添加shade插件 &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-shade-plugin&lt;/artifactId&gt; &lt;version&gt;1.7.1&lt;/version&gt; &am

小埋酱 1620

No log4j2 configuration file found.

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_34128237的博客 960

IDEA中运行Spark报日志和SLF4J问题

1.在resources目录中添加log4j.properties文件,解决输出很多日志的问题2.在pom.xml中将存在slf4j冲突的包排除掉,解决输出slf4j问题3.在resources目录中添加log4j2.xml文件,解决输出error问题下面给出修改后的pom.xml文件。

weixin_52254672的博客 1701
上一篇: JDBC 连接 hive2 遇到的java.lang.ClassNotFoundException: org.apache.hive.jdbc.HiveDriver
下一篇: iptables只允许指定ip访问本机的指定端口
system1024
博客等级 码龄16年 11粉丝 24原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值