[
https://issues.apache.org/jira/browse/LOG4J2-1888?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15981748#comment-15981748
]
Gary Gregory commented on LOG4J2-1888:
--------------------------------------
Can you post your config file please?
> Log4j throws a java.nio.charset.UnsupportedCharsetException: cp65001
> --------------------------------------------------------------------
>
> Key: LOG4J2-1888
> URL: https://issues.apache.org/jira/browse/LOG4J2-1888
> Project: Log4j 2
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.8.2
> Reporter: Misagh Moayyed
>
> Running a Java spring boot web application using a "java -jar" type of
> command with a pretty vanilla log4j2.xml file in it, I see the following
> error.
> {code}
> 2017-04-24 11:47:45,338 main ERROR Unable to inject fields into builder class
> for plugin type class org.apache.logging.log4j.core.appender.ConsoleAppender,
> element Console. java.nio.charset.UnsupportedCharsetException: cp65001
> at java.nio.charset.Charset.forName(Charset.java:531)
> at
> org.apache.logging.log4j.util.PropertiesUtil.getCharsetProperty(PropertiesUtil.java:146)
> at
> org.apache.logging.log4j.util.PropertiesUtil.getCharsetProperty(PropertiesUtil.java:134)
> at
> org.apache.logging.log4j.core.appender.ConsoleAppender$Target.getCharset(ConsoleAppender.java:85)
> at
> org.apache.logging.log4j.core.appender.ConsoleAppender$Target$1.getDefaultCharset(ConsoleAppender.java:71)
> at
> org.apache.logging.log4j.core.appender.ConsoleAppender$Builder.build(ConsoleAppender.java:218)
> at
> org.apache.logging.log4j.core.appender.ConsoleAppender$Builder.build(ConsoleAppender.java:185)
> at
> org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122)
> at
> org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:952)
> at
> org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:892)
> at
> org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:884)
> at
> org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:508)
> at
> org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:232)
> at
> org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:244)
> {code}
> I am running the "run" command on Windows 10 64x inside a ConEmu console. If
> I switch to Babun, then I don't see the error.
> This may not exactly be a "bug", but it would be great to not crash the app
> and fallback to a more accepting encoding perhaps.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)