java.lang.NoClassDefFoundError: com/mongodb/DBObject

JIRA | Nitin | 3 years ago
  1. 0

    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

    JIRA | 3 years ago | Nitin
    java.lang.NoClassDefFoundError: com/mongodb/DBObject
  2. 0

    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

    JIRA | 3 years ago | Nitin
    java.lang.NoClassDefFoundError: com/mongodb/DBObject
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    InputStream.getResourceAsStream() giving null pointer exception

    Stack Overflow | 2 years ago | CodeMed
    java.lang.NoClassDefFoundError: maintest/TestFunctions
  5. 0

    persisting hyperjaxb-generated entities to mysql from eclipse

    Stack Overflow | 2 years ago | CodeMed
    java.lang.NoClassDefFoundError: maintest/TestFunctions

  1. archenroot 1 times, last 2 weeks ago
  2. tyson925 5 times, last 2 weeks ago
  3. tzrlk 1 times, last 2 weeks ago
  4. musketyr 1 times, last 3 weeks ago
  5. kjhdofjosvs 3 times, last 3 weeks ago
63 more registered users
32 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.ClassNotFoundException

    com.mongodb.DBObject

    at java.net.URLClassLoader$1.run()
  2. Java RT
    ClassLoader.loadClass
    1. java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    2. java.security.AccessController.doPrivileged(Native Method)
    3. java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    4. java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    5. sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    6. java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    6 frames
  3. com.mongodb.hadoop
    HiveMongoInputFormat.getSplits
    1. com.mongodb.hadoop.splitter.MongoSplitterFactory.getSplitterByClass(MongoSplitterFactory.java:45)
    2. com.mongodb.hadoop.splitter.MongoSplitterFactory.getSplitter(MongoSplitterFactory.java:109)
    3. com.mongodb.hadoop.hive.input.HiveMongoInputFormat.getSplits(HiveMongoInputFormat.java:64)
    4. com.mongodb.hadoop.hive.input.HiveMongoInputFormat.getSplits(HiveMongoInputFormat.java:44)
    4 frames
  4. Hive Query Language
    Driver.getResults
    1. org.apache.hadoop.hive.ql.exec.FetchOperator.getRecordReader(FetchOperator.java:383)
    2. org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:511)
    3. org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow(FetchOperator.java:491)
    4. org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:136)
    5. org.apache.hadoop.hive.ql.Driver.getResults(Driver.java:1412)
    5 frames
  5. org.apache.hadoop
    CliDriver.main
    1. org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:271)
    2. org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:216)
    3. org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:413)
    4. org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:756)
    5. org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:614)
    5 frames
  6. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    4. java.lang.reflect.Method.invoke(Method.java:597)
    4 frames
  7. Hadoop
    RunJar.main
    1. org.apache.hadoop.util.RunJar.main(RunJar.java:160)
    1 frame