The Hortonworks Community Connection is now live. A completely rebuilt Q&A forum, Knowledge Base, Code Hub and more, backed by the experts in the industry.

You will be redirected here in 10 seconds. If your are not redirected, click here to visit the new site.

The legacy Hortonworks Forum is now closed. You can view a read-only version of the former site by clicking here. The site will be taken offline on January 31,2016

Sqoop Forum

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

  • #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

  • Author
    Replies
  • #48235
    Robert Molina
    Keymaster

    Hi Sourabh,
    Maybe the following may help:
    http://stackoverflow.com/questions/9229611/how-to-use-sqoop-in-java-program

    Regards,
    Robert

    #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

    #49598
    Robert Molina
    Keymaster

    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

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

Support from the Experts

A HDP Support Subscription connects you experts with deep experience running Apache Hadoop in production, at-scale on the most demanding workloads.

Enterprise Support »

Become HDP Certified

Real world training designed by the core architects of Hadoop. Scenario-based training courses are available in-classroom or online from anywhere in the world

Training »

Hortonworks Data Platform
The Hortonworks Data Platform is a 100% open source distribution of Apache Hadoop that is truly enterprise grade having been built, tested and hardened with enterprise rigor.
Get started with Sandbox
Hortonworks Sandbox is a self-contained virtual machine with Apache Hadoop pre-configured alongside a set of hands-on, step-by-step Hadoop tutorials.
Modern Data Architecture
Tackle the challenges of big data. Hadoop integrates with existing EDW, RDBMS and MPP systems to deliver lower cost, higher capacity infrastructure.