How to avoid Decoding Error: sun/io/ByteToCharConverter with JDK 1.8, iManager 2.7.x

0 Likes
over 5 years ago

During the upgrade from IDM 4.0.2 to 4.5 IDM needs JDK 1.8, but if you run your iManager with JDK 1.8 and try to make use of the SecretStore plugin, you will see this error:

Error: Monitor SecretStore failed.
-1 Decoding Error: sun/io/ByteToCharConverter

Unfortunately sun.io.ByteToCharConvertor was removed in Java 8. To make it work we manually added the deprecated classes from a JDK 7 inside the WEB-INF/lib of tomcat:

    1. copy the attached(deprecatedSun) deprecatedSun.jar (you have to unzip it) inside your  /var/opt/novell/iManager/nps/WEB-INF/lib

 

    1. change the file permission with chown novlwww:novlwww deprecatedSun.jar

 

    1. restart tomcat



Your plug-in will work as expected again.

What are you going to add? Simply the sun.io and sun.nio files already present in java 1.7 downloaded from https://sourceforge.net/projects/jdk7src/?source=typ_redirect.

To compile them we had to change only the file sun.nio.ch.util.java, rewriting the following method:


static void load() {
synchronized (Util.class) {
if (loaded)
return;
loaded = true;
GetPropertyAction a = new GetPropertyAction("net");
java.security.AccessController
.doPrivileged(a);
GetPropertyAction b = new GetPropertyAction("nio");
java.security.AccessController
.doPrivileged(b);
// IOUtil must be initialized; Its native methods are called from
// other places in native nio code so they must be set up.
IOUtil.initIDs();
}
}



Hope this helps someone else in our conditions. This jar is probably useful even for IDM engine if you provision NSS secrets.

Labels:

How To-Best Practice
Comment List
Anonymous
Related Discussions
Recommended