How resolve the "java.lang.NoClassDefFoundError: sun/io/CharToByteConverter" error thrown by JPublisher for wrapper package generation required for Oracle/Custom API activity
book
Article ID: KB0079585
calendar_today
Updated On:
Products
Versions
TIBCO ActiveMatrix BusinessWorks Plug-in for Oracle E-Business Suite
1.x,6.x
Description
Description: ========= Oracle JPublisher is a command line utility provided by Oracle. It can generate Java classes and PL/SQL scripts to enable access to the database objects such as tables, stored procedures, and data structures through Java code. When supplied with the correct parameters, Oracle JPublisher generates two types of output: •It generates a PL/SQL script that exposes the custom data types, stored procedures, and functions contained in a package by creating SQL types and a wrapper package that permits the internals of the original package to be more accessible and callable. •It generates Java classes which utilize the generated wrapper PL/SQL scripts. These wrapper Java classes model the database objects and can be used programmatically to execute the contents of the selected package.
TIBCO ActiveMatrix BusinessWorks Plug-in for Oracle E-Business Suite relies on Oracle JPublisher to generate PL/SQL scripts in some instances where programmatically accessing the database objects is not possible. Oracle E-Business Suite APIs that required data structures defined within the API packages require the wrappers generated by Oracle JPublisher because these data structure definitions are not accessible outside of the package. Using the wrappers, TIBCO ActiveMatrix BusinessWorks Plug-in for Oracle E-Business Suite can thus invoke the procedures contained inside the Oracle E-Business Suite APIs packages.
While executing JPublisher with JDK 1.8 to generate PL/SQL scripts to enable the access to the database objects for Oracle/Custom API activity.It throws below error: ======= Exception in thread "main" java.lang.NoClassDefFoundError: sun/io/CharToByteConverter at sqlj.util.io.OracleOutputStreamWriter.<init>(OracleOutputStreamWriter.java:82) at oracle.jpub.publish.JavaPublisher.writeRefFile(JavaPublisher.java:804) at oracle.jpub.publish.JavaPublisher.publish(JavaPublisher.java:330) at oracle.jpub.DoitImpl.mainSql(DoitImpl.java:380) at oracle.jpub.DoitImpl.main(DoitImpl.java:110) at oracle.jpub.Doit.main(Doit.java:28) at oracle.jpub.publish.Main.main(Main.java:9) at oracle.jpub.Main.main(Main.java:6) Caused by: java.lang.ClassNotFoundException: sun.io.CharToByteConverter at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) =======
Symptoms: ======== When trying to execute JPublisher with JDK 1.8, there is above error occurs. While using JDK 1.7 the JPublisher works fine.
Cause: ===== This is because the "sun/io/CharToByteConverter.class" was deprecated in the JDK 1.8.When checking for the existence of the "sun/io/CharToByteConverter.class" class in the JDK 1.7, this class was present in the jre/lib/rt.jar for the versions below JDK 1.8.
Issue/Introduction
How resolve the "java.lang.NoClassDefFoundError: sun/io/CharToByteConverter" error thrown by JPublisher for wrapper package generation required for Oracle/Custom API activity
Environment
Product: TIBCO BusinessWorks Plugin for Oracle E-Business Suite
Version:1.x,6.x
OS: All Supported Operating Systems
Resolution
JPublisher should be used with the JDK packaged with the Oracle Software.
For Database 11g is JDK 1.5
For Database 12c is JDK 1.6
The reason is that if the classes are loaded to the database, the database uses that JDK and it may generate other issues using other JDK versions.