Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I've upgraded my ServiceMix to Fuse ESB 4.4 compilation. 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. Files are encoded in Windows-1250 encoding (characters from that set are correctly converted, others are, of course, not available).

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. Had anyone dealt successfully with it?

like image 984
Danubian Sailor Avatar asked Feb 23 '23 20:02

Danubian Sailor


1 Answers

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.

Although this will exist in the runtime of a JVM with no class loader constraints, in an OSGi runtime the code will fail.

The solution will be to modify the bundle that's generating this error message with the following:

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.

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?

like image 88
AlBlue Avatar answered Feb 25 '23 12:02

AlBlue