Subject: [mongodb-user] Unable to connect Hive with MongoDB
using mongo-hadoop connector


I am begI am trying to install and configure hive with mongo-hadoop-core 2.0.2, for the first time. I have installed hadoop 2.8.0, Hive 2.1.1 and MongoDB 3.4.6. and everything works fine when running individually.

My problem is, I am not able to connect MongoDB with Hive. I am using mongo-Hadoop connector for this as mentioned here The required jars are added to Hadoop and Hive lib. Even I add them in or runtime from hive console. I am getting error while executing Create table query

My Query is

 STORED BY 'com.mongodb.hadoop.hive.MongoStorageHandler' WITH

And I get the following error

FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. com/mongodb/hadoop/io/BSONWritable
hive> ERROR hive.ql.exec.DDLTask - java.lang.NoClassDefFoundError: com/mongodb/hadoop/io/BSONWritable
at com.mongodb.hadoop.hive.BSONSerDe.initialize(
at org.apache.hadoop.hive.serde2.SerDeUtils.initializeSerDe(
at org.apache.hadoop.hive.metastore.MetaStoreUtils.getDeserializer(
at org.apache.hadoop.hive.metastore.MetaStoreUtils.getDeserializer(
at org.apache.hadoop.hive.ql.metadata.Table.getDeserializerFromMetaStore(
at org.apache.hadoop.hive.ql.metadata.Table.getDeserializer(Table.jav...


It shows that com/mongodb/hadoop/io/BSONWritable class is not in classpath but I have added the required(mongo-hadoop-core.jar) jar and class are present in the jar.

The version of jars I am using

mongo-hadoop-core 2.0.2,

mongo-hadoop-hive 2.0.2,

mongo-java-driver 3.0.2


You received this message because you are subscribed to the Google Groups "mongodb-user"
For other MongoDB technical support options, see:
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at
To view this discussion on the web visit
For more options, visit

Programming list archiving by: Enterprise Git Hosting