Home Forums Sqoop Getting java.lang.NoSuchFieldError: IBM_JAVA while running Sqoop from Java

This topic contains 3 replies, has 2 voices, and was last updated by  Robert Molina 4 months, 3 weeks ago.

  • Creator
    Topic
  • #48141

    Sourabh Potnis
    Participant

    Hi,
    I am trying to run Sqoop from a Java program using Sqoop.runTool(str), to export data to Teradata from HDFS.

    While compiling, I have added following Jars:
    /etc/hadoop/conf:/usr/lib/sqoop/sqoop-1.4.4.2.0.6.0-76.jar, all jars in/usr/lib/sqoop/lib, /usr/lib/hadoop/hadoop-common-2.2.0.2.0.6.0-76.jar, all jars in /usr/lib/hadoop/lib, /usr/lib/hadoop-mapreduce/hadoop-mapreduce-client-core-2.2.0.2.0.6.0-76.jar, all jars in /usr/lib/hadoop-mapreduce, all jars in /usr/lib/hadoop-mapreduce/lib

    But when running the jar, getting following error:
    Exception in thread “main” java.lang.NoSuchFieldError: IBM_JAVA
    at org.apache.hadoop.security.UserGroupInformation.getOSLoginModuleName(UserGroupInformation.java:303)
    at org.apache.hadoop.security.UserGroupInformation.<clinit>(UserGroupInformation.java:348)
    at org.apache.hadoop.mapreduce.JobContext.<init>(JobContext.java:80)
    at org.apache.hadoop.mapreduce.Job.<init>(Job.java:100)
    at org.apache.sqoop.mapreduce.ExportJobBase.runExport(ExportJobBase.java:382)
    at org.apache.sqoop.teradata.TeradataConnManager.exportTable(TeradataConnManager.java:109)
    at org.apache.sqoop.tool.ExportTool.exportTable(ExportTool.java:81)
    at org.apache.sqoop.tool.ExportTool.run(ExportTool.java:100)
    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:222)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:231)
    at SqoopTest.exportHDFSToSQL(SqoopTest.java:20)
    at SqoopTest.main(SqoopTest.java:46)

    (From a command line Sqoop export is working fine.)

    Thanks,
    Sourabh

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Getting java.lang.NoSuchFieldError: IBM_JAVA while running Sqoop from Java’ is closed to new replies.

  • Author
    Replies
  • #49598

    Robert Molina
    Moderator

    Hi Sourabh,
    Can you try installing a certified version of JDK with the HDP cluster you have? Here is the link:

    http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.0.9.1/bk_using_Ambari_book/content/ambari-chap1-2.html#ambari-chap1-2-5

    The following Java runtimes are supported:

    Oracle JDK 1.6.0_31 64-bit

    Oracle JDK 1.7 64-bit

    OpenJDK 7 64-bit

    Regards,
    Robert

    Collapse
    #48249

    Sourabh Potnis
    Participant

    Hi,

    Thanks Robert.

    I have gone through this post before.

    I have compiled my Java program correctly with all dependencies.

    The problem (Exception in thread “main” java.lang.NoSuchFieldError: IBM_JAVA )arises when I am trying to run the jar.

    Java version:
    java version “1.6.0_24″
    OpenJDK Runtime Environment (IcedTea6 1.11.11.90) (rhel-1.62.1.11.11.90.el6_4-x86_64)
    OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

    On HDP Hadoop 2.2.0.2.0.6.0-76

    Thanks,
    Sourabh

    Collapse
    #48235

    Robert Molina
    Moderator

    Hi Sourabh,
    Maybe the following may help:

    http://stackoverflow.com/questions/9229611/how-to-use-sqoop-in-java-program

    Regards,
    Robert

    Collapse
Viewing 3 replies - 1 through 3 (of 3 total)