Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Sqoop Db2 import Issue - Error: java.lang.ClassNotFoundException: sun.io.UnknownCharacterException

Sqoop Db2 import Issue - Error: java.lang.ClassNotFoundException: sun.io.UnknownCharacterException

New Contributor

Hello,

I am trying to connect to the DB2 database v9.1-1.

Db2 connection successfully established , but its throwing an exception like below.

16/11/07 16:37:58 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=xx.xx.xxx.xx:2181 sessionTimeout=90000 watcher=org.apache.hadoop.hbase.zookeeper.PendingWatcher@77eb5790 16/11/07 16:37:58 INFO zookeeper.ClientCnxn: Opening socket connection to server xx.xx.xx.xx/xx.xx.xs.xx:2181. Will not attempt to authenticate using SASL (unknown error) 16/11/07 16:37:58 INFO zookeeper.ClientCnxn: Socket connection established to xx.xx.xx.xx/xx.xx.xs.xx:2181, initiating session 16/11/07 16:37:58 INFO zookeeper.ClientCnxn: Session establishment complete on server xx.xx.xx.xx/xx.xx.xs.xx:2181, sessionid = 0x1582ed454960c7c, negotiated timeout = 40000 16/11/07 16:37:59 INFO mapreduce.HBaseImportJob: Creating missing HBase table ABC 16/11/07 16:38:02 INFO client.HBaseAdmin: Created ABC 16/11/07 16:38:02 INFO client.ConnectionManager$HConnectionImplementation: Closing master protocol: MasterService 16/11/07 16:38:02 INFO client.ConnectionManager$HConnectionImplementation: Closing zookeeper sessionid=0x1582ed454960c7c 16/11/07 16:38:02 INFO zookeeper.ZooKeeper: Session: 0x1582ed454960c7c closed 16/11/07 16:38:02 INFO zookeeper.ClientCnxn: EventThread shut down 16/11/07 16:38:02 INFO impl.TimelineClientImpl: Timeline service address: http://xx.xx.xx.xx:8188/ws/v1/timeline/ 16/11/07 16:38:02 INFO client.RMProxy: Connecting to ResourceManager at xxx.xx.xx.xx/xx.xx.xx.xx:8050 16/11/07 16:38:02 INFO client.AHSProxy: Connecting to Application History server at xx.xx.xx.xx/xx.xx.xs.xx:10200 16/11/07 16:38:10 INFO db.DBInputFormat: Using read commited transaction isolation 16/11/07 16:38:10 INFO mapreduce.JobSubmitter: number of splits:1 16/11/07 16:38:10 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1478256182227_0007 16/11/07 16:38:11 INFO impl.YarnClientImpl: Submitted application application_1478256182227_0007 16/11/07 16:38:11 INFO mapreduce.Job: The url to track the job: http://xxx.xx.xxx.xx:8088/proxy/application_1478256182227_0007/ 16/11/07 16:38:11 INFO mapreduce.Job: Running job: job_1478256182227_0007 16/11/07 16:38:18 INFO mapreduce.Job: Job job_1478256182227_0007 running in uber mode : false 16/11/07 16:38:18 INFO mapreduce.Job: map 0% reduce 0% 16/11/07 16:38:22 INFO mapreduce.Job: Task Id : attempt_1478256182227_0007_m_000000_0, Status : FAILED Error: java.lang.ClassNotFoundException: sun.io.UnknownCharacterException at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at com.ibm.db2.jcc.b.a.<init>(a.java:238) at com.ibm.db2.jcc.b.b.a(b.java:1624) at com.ibm.db2.jcc.c.p.a(p.java:350) at com.ibm.db2.jcc.c.p.<init>(p.java:404) at com.ibm.db2.jcc.b.b.<init>(b.java:256) at com.ibm.db2.jcc.DB2Driver.connect(DB2Driver.java:163) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:247) at org.apache.sqoop.mapreduce.db.DBConfiguration.getConnection(DBConfiguration.java:302) at org.apache.sqoop.mapreduce.db.DBInputFormat.getConnection(DBInputFormat.java:213) at org.apache.sqoop.mapreduce.db.DBInputFormat.setConf(DBInputFormat.java:165) at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:76) at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:136) at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:749) at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341) at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:168) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:422) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1724) at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:162)

I also edited mapred-site.xml and set "mapreduce.map.java.opts" to -Xmx1024m -Ddb2.jcc.charsetDecoderEncoder=3

but still getting issue. can you please suggest what needs to check to load data from db2 to Hbase table.

sqoop import -Ddb2.jcc.charsetDecoderEncoder=3 --connect "jdbc:db2://server:port/DB/TABLE;" --username xx --password xx--table <tabname> --columns "<colnames>" --hbase-create-table --hbase-table <tabname> --column-family name --hbase-row-key name -m 1

7 REPLIES 7
Highlighted

Re: Sqoop Db2 import Issue - Error: java.lang.ClassNotFoundException: sun.io.UnknownCharacterException

Contributor

Either you need to upgrade the DB2Driver version which supports JDK 8 or downgrade your JDK version which is supported by your DB2 Driver.

Re: Sqoop Db2 import Issue - Error: java.lang.ClassNotFoundException: sun.io.UnknownCharacterException

New Contributor

Earlier i was facing connection issue for which Jdbc drivers are copied with the DB2 version and it works. Again by copying the new version it may create an connection issue ?

Re: Sqoop Db2 import Issue - Error: java.lang.ClassNotFoundException: sun.io.UnknownCharacterException

Contributor

check on the JDK version supported by your driver ?

Re: Sqoop Db2 import Issue - Error: java.lang.ClassNotFoundException: sun.io.UnknownCharacterException

Contributor

clearly JDK version mismatch

Re: Sqoop Db2 import Issue - Error: java.lang.ClassNotFoundException: sun.io.UnknownCharacterException

New Contributor

Which version needs to be installed then?

Re: Sqoop Db2 import Issue - Error: java.lang.ClassNotFoundException: sun.io.UnknownCharacterException

New Contributor

I have this one installed.

Java(TM) SE Runtime Environment (build 1.8.0_60-b27) Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)

Re: Sqoop Db2 import Issue - Error: java.lang.ClassNotFoundException: sun.io.UnknownCharacterException

New Contributor

can you help me out how it can be resolve step b

Don't have an account?
Coming from Hortonworks? Activate your account here