Thank you JB!
We have some test results for your reference: * Windows 10 English version, CodePage 936, Karaf console display OK * Windows 10 Chinese version, CodePage 936, Not OK, unprintable characters * Windows 7 English version, CodePage 65001, Not OK, unprintable characters, and UnsupportedCharsetException happen sometimes * Windows 7 English version, CodePage 437, Not OK, unprintable characters Thanks. ________________________________ From: Jean-Baptiste Onofré <j...@nanthrax.net> Sent: Tuesday, August 29, 2017 4:26:29 PM To: user@karaf.apache.org Subject: Re: UnsupportedCharsetException: cp65001 and unprintable characters from karaf 4.1.2 console Hi Xilai, thanks for the report. Let me try to reproduce on a VM. Regards JB On 08/29/2017 08:46 AM, XiLai Dai wrote: > Hi there, > > > In case of Windows OS and the cp65001 CodePage setting, there is > UnsupportedCharsetException: cp65001 happening and the console display really > not good many of the unprintable characters showing ... > > > 2017-08-29 11:34:41,204 CM Configuration Updater (Update: > pid=org.ops4j.pax.logging) ERROR Unable to inject fields into > builder class for plugin type class > org.apache.logging.log4j.core.appender.ConsoleAppender, element Console. > java.nio.ch > arset.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) > at > org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:545) > at > org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:261) > at > org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl.doUpdate(PaxLoggingServiceImpl.java:213) > at > org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl.updated(PaxLoggingServiceImpl.java:158) > at > org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl$1ManagedPaxLoggingService.updated(PaxLoggingServi > ceImpl.java:426) > at > org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189) > at > org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152) > at > org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85) > at > org.apache.felix.cm.impl.ConfigurationManager$UpdateConfiguration.run(ConfigurationManager.java:1776) > at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141) > at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109) > at java.lang.Thread.run(Thread.java:745) > > 2017-08-29 11:34:41,214 CM Configuration Updater (Update: > pid=org.ops4j.pax.logging) ERROR Unable to invoke factory meth > od in class class org.apache.logging.log4j.core.appender.ConsoleAppender for > element Console. java.lang.IllegalStateExce > ption: No factory method found for class > org.apache.logging.log4j.core.appender.ConsoleAppender > at > org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.findFactoryMethod(PluginBuilder.java:224) > at > org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:130) > 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) > at > org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:545) > at > org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:261) > at > org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl.doUpdate(PaxLoggingServiceImpl.java:213) > at > org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl.updated(PaxLoggingServiceImpl.java:158) > at > org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl$1ManagedPaxLoggingService.updated(PaxLoggingServi > ceImpl.java:426) > at > org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189) > at > org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152) > at > org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85) > at > org.apache.felix.cm.impl.ConfigurationManager$UpdateConfiguration.run(ConfigurationManager.java:1776) > at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141) > at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109) > at java.lang.Thread.run(Thread.java:745) > > 2017-08-29 11:34:41,224 CM Configuration Updater (Update: > pid=org.ops4j.pax.logging) ERROR Null object returned for Cons > ole in Appenders. > 2017-08-29 11:34:41,224 CM Configuration Updater (Update: > pid=org.ops4j.pax.logging) ERROR Unable to locate appender "Co > nsole" for logger config "root" > 2017-08-29 11:34:42,084 CM Configuration Updater (ManagedService Update: > pid=[org.ops4j.pax.logging]) ERROR Unable to in > ject fields into builder class for plugin type class > org.apache.logging.log4j.core.appender.ConsoleAppender, element Con > sole. 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) > at > org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:545) > at > org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:261) > at > org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl.doUpdate(PaxLoggingServiceImpl.java:213) > at > org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl.updated(PaxLoggingServiceImpl.java:158) > at > org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl$1ManagedPaxLoggingService.updated(PaxLoggingServi > ceImpl.java:426) > at > org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189) > at > org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152) > at > org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85) > at > org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1463) > at > org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1419) > at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141) > at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109) > at java.lang.Thread.run(Thread.java:745) > > 2017-08-29 11:34:42,094 CM Configuration Updater (ManagedService Update: > pid=[org.ops4j.pax.logging]) ERROR Unable to in > voke factory method in class class > org.apache.logging.log4j.core.appender.ConsoleAppender for element Console. > java.lang > .IllegalStateException: No factory method found for class > org.apache.logging.log4j.core.appender.ConsoleAppender > at > org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.findFactoryMethod(PluginBuilder.java:224) > at > org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:130) > 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) > at > org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:545) > at > org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:261) > at > org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl.doUpdate(PaxLoggingServiceImpl.java:213) > at > org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl.updated(PaxLoggingServiceImpl.java:158) > at > org.ops4j.pax.logging.log4j2.internal.PaxLoggingServiceImpl$1ManagedPaxLoggingService.updated(PaxLoggingServi > ceImpl.java:426) > at > org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189) > at > org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152) > at > org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85) > at > org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1463) > at > org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1419) > at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141) > at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109) > at java.lang.Thread.run(Thread.java:745) > > 2017-08-29 11:34:42,094 CM Configuration Updater (ManagedService Update: > pid=[org.ops4j.pax.logging]) ERROR Null object > returned for Console in Appenders. > 2017-08-29 11:34:42,094 CM Configuration Updater (ManagedService Update: > pid=[org.ops4j.pax.logging]) ERROR Unable to lo > cate appender "Console" for logger config "root" > __ __ ____ > / //_/____ __________ _/ __/ > / ,< / __ `/ ___/ __ `/ /_ > / /| |/ /_/ / / / /_/ / __/ > /_/ |_|\__,_/_/ \__,_/_/ > > Apache Karaf (4.1.2) > > Hit '<tab>' for a list of available commands > and '[cmd] --help' for help on a specific command. > Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf. > > karaf@root()> list > START LEVEL 100 , List Threshold: 50 > ID �� State �� Lvl �� Version �� Name > �������������������������������������������������������������������������������������������������������������������� > �������������������������������������������������������������������������������������������������������������� > 28 �� Active �� 80 �� 4.1.2 �� Apache Karaf :: OSGi Services :: Event > Event > > > After "chcp 437", the UnsupportedCharsetException gone but the console display > still looks not good. > > > Seems it's only happening on Windows OS (Non English version) with 65001 > CodePage. but karaf 4.1.1 works well on the same machine/ENV. Is something > problem related to the JLine upgrade? any thoughts? Thanks > > > Regards. > -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com