1

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

Community
  • 1
  • 1
  • 4
    Are you using `UnknownCharacterException`? Is that really the *full* stacktrace? – Andreas Sep 14 '16 at 20:33
  • Hi Andreas, I have updated my question with full stack trace. This exception occurs when we try to install our application using IBM JDK8 SR3. With JDK7 it works fine. Can you please advice were should I look into to get to the root of the problem? – Anish Kumar E.M Sep 15 '16 at 09:59
  • 2
    So apparently, the class `com.xxxxxxxxx.yyyyyyyy.dmi.visibility.event.AFCDmiVisEventFactory` is using the class `sun.io.UnknownCharacterException`, which is not part of the standard Java API. Just fix that… – Holger Sep 15 '16 at 12:50
  • 1
    That is why you should never use `sun.` classes, because they only exist in the Sun/Oracle version of the JRE. You might want to scan your code for any other bombs, ehhhhh, I mean references to `sun.`. – Andreas Sep 15 '16 at 15:48

1 Answers1

2

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).

  • Hi, I do not see our application directly using sun.io.* . Its some of the internal jars that is making use of it. Identifying the source has becoming challenging and that is what I am looking into now. – Anish Kumar E.M Oct 04 '16 at 06:44
  • As Holger already updated in his early comment, the class com.xxxxxxxxx.yyyyyyyy.dmi.visibility.event.AFCDmiVisEventFa‌​ctory is using the class sun.io.UnknownCharacterException, which is not part of the standard Java API. – Nasser Ebrahim Nov 17 '16 at 13:25