NoClassDefFoundError: com/teradata/jdbc/jdk6/JDK6_SQL_ResultSetMetaData解决办法

环境:

TD:Teradata15.00.02.08

CDH:CDH5.13.0

20/07/16 05:16:15 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6-cdh5.13.0
20/07/16 05:16:15 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
20/07/16 05:16:15 INFO teradata.TeradataManagerFactory: Loaded connector factory for 'Cloudera Connector Powered by Teradata' on version 1.6c5
20/07/16 05:16:15 INFO manager.SqlManager: Using default fetchSize of 1000
20/07/16 05:16:15 INFO options.ExtraOptions: Parsing extra arguments
20/07/16 05:16:15 INFO options.OptionsCompatibility: Checking options compatibility
20/07/16 05:16:15 INFO teradata.SchemaInjector: Using connection string: jdbc:teradata://192.169.2.95/DATABASE=sdata
20/07/16 05:16:17 INFO tool.CodeGenTool: Beginning code generation
20/07/16 05:16:17 INFO teradata.TeradataManager: Converting table import to query: SELECT * FROM "sqoop_test1_p"
Exception in thread "main" java.lang.NoClassDefFoundError: com/teradata/jdbc/jdk6/JDK6_SQL_ResultSetMetaData
    at com.teradata.connector.teradata.db.TeradataConnection.getColumnDescs(TeradataConnection.java:2494)
    at com.teradata.connector.teradata.db.TeradataConnection.getColumnDescsForSQL(TeradataConnection.java:998)
    at com.teradata.connector.teradata.db.TeradataConnection.getColumnTypesForSQL(TeradataConnection.java:960)
    at com.cloudera.connector.teradata.TeradataManager.getColumnTypes(TeradataManager.java:203)
    at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:327)
    at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1858)
    at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1657)
    at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:106)
    at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:494)
    at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:621)
    at org.apache.sqoop.Sqoop.run(Sqoop.java:147)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
    at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:243)
    at org.apache.sqoop.Sqoop.main(Sqoop.java:252)
Caused by: java.lang.ClassNotFoundException: com.teradata.jdbc.jdk6.JDK6_SQL_ResultSetMetaData
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 16 more
[root@quickstart ~]# 

NoClassDefFoundError: com/teradata/jdbc/jdk6/JDK6_SQL_ResultSetMetaData解决办法_第1张图片

NoClassDefFoundError: com/teradata/jdbc/jdk6/JDK6_SQL_ResultSetMetaData解决办法_第2张图片

 

问题原因:

sqoop-connector-teradata.jar(1.6.0c5、1.6.1c5、1.7.0c5)里面包含com.teradata.jdbc.jdk6.JDK6_SQL_ResultSetMetaData类

在新版的terajdbc4.jar中没有这个类。

因此需要找到sqoop-connector-teradata.jar支持的Teradata版本下的terajdbc4.jar,虽然叫同样的名字,但版本不一样。

解决办法:

在安装Teradata的机器上找到terajdbc4.jar 文件,放在sqoop/lib目录下,修改权限为755.


Sqoop集成Teradata驱动参考:https://blog.csdn.net/weixin_34128534/article/details/92537839

你可能感兴趣的:(Teradata,sqoop)