简体   繁体   English

来自日志子系统Fuse ESB 4.4的UTF-8不支持消息

[英]UTF-8 not supported message from logging subsystem, Fuse ESB 4.4

I've upgraded my ServiceMix to Fuse ESB 4.4 compilation. 我已将ServiceMix升级到Fuse ESB 4.4编译。 I got, however, errors from logging system, which I can't find how to handle. 但是,我得到了日志系统的错误,我找不到如何处理。

The error message is: 错误消息是:

Warning: encoding "UTF-8" not supported, using UTF-8

The encoding UTF-8 is NOT used. 不使用编码UTF-8。 Files are encoded in Windows-1250 encoding (characters from that set are correctly converted, others are, of course, not available). 文件以Windows-1250编码进行编码(该组中的字符已正确转换,其他字符当然不可用)。

I've found discussion about similar problem here on StackOverflow, where there was identified a problem with Xerces parser, however without a clue, how to solve it in this particular case. 我在StackOverflow上找到了关于类似问题的讨论 ,其中发现了Xerces解析器的问题,但是没有线索,如何在这种特殊情况下解决它。 Had anyone dealt successfully with it? 有没有人成功处理过它?

The problem is that something is attempting to access the UTF-8 character set (probably via Charset.forName("UTF-8")) which is attempting to instantiate a class in a package sun.nio.cs.UTF_8. 问题是某些东西试图访问UTF-8字符集(可能是通过Charset.forName(“UTF-8”)),它试图在sun.nio.cs.UTF_8包中实例化一个类。

Although this will exist in the runtime of a JVM with no class loader constraints, in an OSGi runtime the code will fail. 虽然这将存在于没有类加载器约束的JVM的运行时中,但在OSGi运行时中,代码将失败。

The solution will be to modify the bundle that's generating this error message with the following: 解决方案是使用以下内容修改生成此错误消息的包:

Import-Package: ...,sun.nio.cs;resolution:=optional Import-Package:...,sun.nio.cs; resolution:= optional

That means that should it attempt to instantiate a class in that package, it should be able to find it - however, if it's not present (say, because you are using a different runtime) then it will still work. 这意味着如果它试图在该包中实例化一个类,它应该能够找到它 - 但是,如果它不存在(比如,因为你使用的是不同的运行时),那么它仍然可以工作。

Note that this implies the System.bundle is exporting the sun.nio.cs package, which you can do by generating a Fragment (see http://wiki.osgi.org/wiki/Fragment ) or by having the system bundle export the sun.nio.cs package with the org.osgi.framework.system.packages property. 请注意,这意味着System.bundle正在导出sun.nio.cs包,您可以通过生成片段(请参阅http://wiki.osgi.org/wiki/Fragment )或通过让系统包导出带有org.osgi.framework.system.packages属性的sun.nio.cs包。

Either way, it sounds like something that the logging bundle should fix rather than something you'd need to fix - have you reported the bug upstream? 无论哪种方式,它听起来像是日志捆绑应该修复的东西,而不是你需要修复的东西 - 你有没有报告上游的bug?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM