Anish Kumar E.M
Anish Kumar E.M

Reputation: 11

With IBM JDK8 seeing sun.io.UnknownCharacterException exception

When I start our product, I run into this exception. If I switch the JDK to JDK7 it starts up fine.

Caused by: java.lang.ClassNotFoundException: sun.io.UnknownCharacterException
at java.net.URLClassLoader.findClass(URLClassLoader.java:607)
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:846)
at java.lang.ClassLoader.loadClass(ClassLoader.java:825)
at java.lang.ClassLoader.loadClass(ClassLoader.java:805)

Full Stack trace:

com.xxxxxxxxx.yyyyyyyy.install.module_loader.ServiceInstallException: InstallSI.ModuleLoader()->Failed while loading package: /home/contbld2/cruisecontrol/main/bin/sandbox/install/middleware/d_platform_ifc_1030400.jar
at com.xxxxxxxxx.yyyyyyyy.install.InstallSI.MiddlewareModuleLoader(InstallSI.java:1767)
at com.xxxxxxxxx.yyyyyyyy.install.InstallSI.PerformInstall(InstallSI.java:920)
at com.xxxxxxxxx.yyyyyyyy.install.InstallSI.main(InstallSI.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:508)
at com.xxxxxxxxx.yyyyyyyy.install.InstallSIBootstrapper.instanciateAndRun(InstallSIBootstrapper.java:376)
at com.xxxxxxxxx.yyyyyyyy.install.InstallSIBootstrapper.instanciateAndRun(InstallSIBootstrapper.java:380)
at com.xxxxxxxxx.yyyyyyyy.install.InstallSIBootstrapper.doIt(InstallSIBootstrapper.java:192)
at com.xxxxxxxxx.yyyyyyyy.install.InstallSIBootstrapper.main(InstallSIBootstrapper.java:80)
<BR>
Caused by: java.lang.Exception: java.lang.reflect.InvocationTargetException
at com.xxxxxxxxx.yyyyyyyy.install.InstallSI.MiddlewareModuleLoader(InstallSI.java:1743)
... 10 more
<BR>
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:508)
at com.xxxxxxxxx.yyyyyyyy.install.InstallSI.MiddlewareModuleLoader(InstallSI.java:1740)
... 10 more
<BR>
Caused by: java.lang.NoClassDefFoundError: sun.io.UnknownCharacterException
at com.xxxxxxxxx.yyyyyyyy.dmi.visibility.event.AFCDmiVisEventFactory.fireAdminAuditEvent(AFCDmiVisEventFactory.java:631)
at com.xxxxxxxxx.yyyyyyyy.services.SDI.save(SDI.java:1144)
at com.xxxxxxxxx.yyyyyyyy.ui.ServiceDefinition.loadDb(ServiceDefinition.java:999)
at com.xxxxxxxxx.yyyyyyyy.ui.ServiceDefinition.loadDb(ServiceDefinition.java:919)
at com.xxxxxxxxx.yyyyyyyy.ui.ServiceDefinition.work(ServiceDefinition.java:1135)
at com.xxxxxxxxx.yyyyyyyy.install.utils.SIICallableImpl.ServiceDefinition(SIICallableImpl.java:47)
at com.xxxxxxxxx.yyyyyyyy.install.module_loader.ServiceInstall.processSDI(ServiceInstall.java:1434)
at com.xxxxxxxxx.yyyyyyyy.install.module_loader.ServiceInstall.doServiceCommonTasks(ServiceInstall.java:1207)
at com.xxxxxxxxx.yyyyyyyy.install.module_loader.ServiceInstall.installService(ServiceInstall.java:994)
at com.xxxxxxxxx.yyyyyyyy.install.module_loader.ServiceInstall.install(ServiceInstall.java:522)
at com.xxxxxxxxx.yyyyyyyy.install.module_loader.ServiceInstall.install(ServiceInstall.java:253)
at com.xxxxxxxxx.yyyyyyyy.install.module_loader.ServiceInstall.installComponents(ServiceInstall.java:611)
at com.xxxxxxxxx.yyyyyyyy.install.module_loader.ServiceInstall.install(ServiceInstall.java:560)
at com.xxxxxxxxx.yyyyyyyy.install.module_loader.ServiceInstall.install(ServiceInstall.java:253)
at com.xxxxxxxxx.yyyyyyyy.install.module_loader.ServiceInstall.installComponents(ServiceInstall.java:611)
at com.xxxxxxxxx.yyyyyyyy.install.module_loader.ServiceInstall.install(ServiceInstall.java:560)
at com.xxxxxxxxx.yyyyyyyy.install.module_loader.ServiceInstall.install(ServiceInstall.java:232)
at com.xxxxxxxxx.yyyyyyyy.install.module_loader.ServiceInstall.installWithLoader(ServiceInstall.java:282)
... 15 more
<BR>
Caused by: java.lang.ClassNotFoundException: sun.io.UnknownCharacterException
at java.net.URLClassLoader.findClass(URLClassLoader.java:607)
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:846)
at java.lang.ClassLoader.loadClass(ClassLoader.java:825)
at java.lang.ClassLoader.loadClass(ClassLoader.java:805)
... 33 more

Might be similar to this one, but I see this problem with all databases: Connect to DB2 database in eclipse via jdbc

Upvotes: 1

Views: 2427

Answers (1)

Nasser Ebrahim
Nasser Ebrahim

Reputation: 31

The IO code pages (charsets) are removed from IBM JDK 8. You have to use NIO charsets in your application in order to resolve the issue. Also, make sure to use the standard Java APIs in the application (Please note that it is not recommended to use implementation classes like sun.io.* in the application as it can be modified/removed anytime without any prior notice).

Upvotes: 2

Related Questions