Uploaded image for project: 'Hadoop Integration'
  1. Hadoop Integration
  2. HADOOP-101

java.lang.ClassNotFoundException: com.mongodb.DBObject

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Done
    • Affects Version/s: mongo-hadoop-1.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      RHEL6.4
      hadoop 1.x
      hive-0.11
      mongo 2.4.x
    • # Replies:
      4
    • Last comment by Customer:
      true

      Description

      I am trying to query data from mongo via hadoop and running in to the issue

      steps
      add jar mongo-2.10.1.jar;
      add jar mongo-hadoop-core_cdh4.3.0-1.2.0-rc1.jar;
      add jar mongo-hadoop-hive_cdh4.3.0-1.2.0-rc1.jar;
      create table influtive(id INT, item string, qty int) STORED BY 'com.mongodb.hadoop.hive.MongoStorageHandler' WITH SERDEPROPERTIES('mongo.columns.mapping'='

      {"id":"_id"}

      ') TBLPROPERTIES('mongo.uri'='mongodb://localhost:27017/test.products');
      select * from influtive;

      Exception in thread "main" java.lang.NoClassDefFoundError: com/mongodb/DBObject
      at com.mongodb.hadoop.splitter.MongoSplitterFactory.getSplitterByClass(MongoSplitterFactory.java:45)
      at com.mongodb.hadoop.splitter.MongoSplitterFactory.getSplitter(MongoSplitterFactory.java:109)
      at com.mongodb.hadoop.hive.input.HiveMongoInputFormat.getSplits(HiveMongoInputFormat.java:64)
      at com.mongodb.hadoop.hive.input.HiveMongoInputFormat.getSplits(HiveMongoInputFormat.java:44)
      at org.apache.hadoop.hive.ql.exec.FetchOperator.getRecordReader(FetchOperator.java:383)
      at org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:511)
      at org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow(FetchOperator.java:491)
      at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:136)
      at org.apache.hadoop.hive.ql.Driver.getResults(Driver.java:1412)
      at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:271)
      at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:216)
      at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:413)
      at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:756)
      at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:614)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.hadoop.util.RunJar.main(RunJar.java:160)
      Caused by: java.lang.ClassNotFoundException: com.mongodb.DBObject
      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      ... 19 more

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                2 years, 22 weeks, 3 days ago
                Date of 1st Reply: