PDA

View Full Version : Use of extended charsets in OSGi


bjoern.voss
Jun 16th, 2008, 12:35 PM
I need to use the extended charsets from the sun.nio.cs.ext package in the charsets.jar of the j2se.

but it seems the META-INF/services/java.nio.charset.spi.CharsetProvider file isn't recognized by the osgi runtime. Even if I add all necessary packages to the systempackages and import them in my bundles I get only the short list when I call Charset.availableCharsets().
I also tried to add a java.nio.charset.spi.CharsetProvider file in each bundle that needs the extended charstes, but even this doesn't work.

The strangest thing for me is, that I get a java.lang.NoClassDefFoundError: sun/nio/cs/ext/IBM918 when I try to instantiate it by hand, although the imports were resolved and my sun.boot.class.path points to:

C:\ Programme\ Java\ jre1.5.0_12\ lib\ rt.jar;C:\ Programme\ Java\ jre1.5.0_12\ lib\ i18n.jar;C:\ Programme\ Java\ jre1.5.0_12\ lib\ sunrsasign.jar;C:\ Programme\ Java\ jre1.5.0_12\ lib\ jsse.jar;C:\ Programme\ Java\ jre1.5.0_12\ lib\ jce.jar;C:\ Programme\ Java\ jre1.5.0_12\ lib\ charsets.jar;C:\ Programme\ Java\ jre1.5.0_12\ classes

which contains the charsets.jar :confused:

Would be great to have any hints on this :)

bjoern.voss
Jun 17th, 2008, 06:05 AM
OK, forget it, it was my stupid fault :rolleyes: