Mongo-hadoop connector (help)

289 views
Skip to first unread message

Fabiola Rojo Orellana

unread,
Jul 19, 2014, 1:52:54 AM7/19/14
to mongod...@googlegroups.com
Hi,
I try to install mongodb connector, but i get this error:
Executing hadoop job:
 /home/fabiola/hadoop-binaries/hadoop-2.4.0/bin/hadoop \
        jar \
        examples/treasury_yield/build/libs/treasury_yield-1.4.0-SNAPSHOT.jar \
        com.mongodb.hadoop.examples.treasury.TreasuryYieldXMLConfig \
        -Dmongo.input.split_size=8 \
        -Dmongo.job.verbose=true \
        -Dmongo.input.uri=mongodb://localhost:27017/mongo_hadoop.yield_historical.in \
        -Dmongo.output.uri=mongodb://localhost:27017/mongo_hadoop.yield_historical.out
Exception in thread "main" java.lang.NoClassDefFoundError: com/mongodb/hadoop/util/MongoTool
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:249)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:205)
Caused by: java.lang.ClassNotFoundException: com.mongodb.hadoop.util.MongoTool
        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 java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        ... 14 more
:historicalYield FAILED

FAILURE: Build failed with an exception.

* Where:
Build file '/home/fabiola/mongo-hadoop/build.gradle' line: 517

* What went wrong:
Execution failed for task ':historicalYield'.
> Process 'command '/home/fabiola/hadoop-binaries/hadoop-2.4.0/bin/hadoop'' finished with non-zero exit value 1


Justin Lee

unread,
Jul 19, 2014, 11:23:48 AM7/19/14
to mongod...@googlegroups.com
run 'gradlew jar' first then run the examples.

--------------------------------

name     : "Justin Lee", 
  title    : "Software Engineer",
  twitter  : "@evanchooly",
  web      : [ "10gen.com", "antwerkz.com" ],
  location : "New York, NY" }


--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
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 mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/b2d5ddec-0f40-434d-a1d2-9ff768ae0cbd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Fabiola Rojo Orellana

unread,
Jul 21, 2014, 1:00:41 AM7/21/14
to mongod...@googlegroups.com
Justin thank! but I did it, the examples not run :(

Justin Lee

unread,
Jul 21, 2014, 7:21:48 AM7/21/14
to mongod...@googlegroups.com
How are you running them exactly, then?  Everything just works on my end: both locally and on jenkins.

--------------------------------

name     : "Justin Lee", 
  title    : "Software Engineer",
  twitter  : "@evanchooly",
  web      : [ "10gen.com", "antwerkz.com" ],
  location : "New York, NY" }


Fabiola Rojo Orellana

unread,
Jul 21, 2014, 9:04:52 AM7/21/14
to mongod...@googlegroups.com
i am running with this page: http://docs.mongodb.org/ecosystem/tutorial/getting-started-with-hadoop/
and i have installed mongo db, hadoop 2.4 (both locally)

Justin Lee

unread,
Jul 21, 2014, 9:14:04 AM7/21/14
to mongod...@googlegroups.com
Hrm.  those are out of date and I meant to update them.  try this:  gradlew testJar historicalYield

--------------------------------

name     : "Justin Lee", 
  title    : "Software Engineer",
  twitter  : "@evanchooly",
  web      : [ "10gen.com", "antwerkz.com" ],
  location : "New York, NY" }


Fabiola Rojo Orellana

unread,
Jul 21, 2014, 9:21:00 AM7/21/14
to mongod...@googlegroups.com

ups! is the unique i found......  if you provide me some tutorial I would appreciate

Justin Lee

unread,
Jul 21, 2014, 9:25:41 AM7/21/14
to mongod...@googlegroups.com

--------------------------------

name     : "Justin Lee", 
  title    : "Software Engineer",
  twitter  : "@evanchooly",
  web      : [ "10gen.com", "antwerkz.com" ],
  location : "New York, NY" }


Fabiola Rojo Orellana

unread,
Jul 21, 2014, 9:32:29 AM7/21/14
to mongod...@googlegroups.com
Thanks!! ... i will try and later tell as it turned (i am noob :/)

Fabiola Rojo Orellana

unread,
Jul 21, 2014, 10:30:06 PM7/21/14
to mongod...@googlegroups.com
i try and i try .... always the similar error .. when i execute ./gradlew historicalYield


El lunes, 21 de julio de 2014 09:14:04 UTC-4, Justin Lee escribió:

Justin Lee

unread,
Jul 22, 2014, 8:37:16 AM7/22/14
to mongod...@googlegroups.com
You still don't seem to be running the correct command.  For clarity, run this:  gradlew jar testJar historicalYield

That should work.  If it doesn't, I don't know what else to tell you.

--------------------------------

name     : "Justin Lee", 
  title    : "Software Engineer",
  twitter  : "@evanchooly",
  web      : [ "10gen.com", "antwerkz.com" ],
  location : "New York, NY" }


Message has been deleted

TJ Tang

unread,
Jul 23, 2014, 4:56:40 AM7/23/14
to mongod...@googlegroups.com
I ran into the same issue, it appears. Tried a few times with frustration. Eventually I found out by running the "hadoop classpath" command. I have installed Hadoop and set the env variable HADOOP_PREFIX to my original install. But the gradlew jar will ignore the existing Hadoop and go ahead to install its own. When try to run "gradlew historicalYield", hadoop is trying to find the Mongo libraries from  under HADOOP_PREFIX/. Hence the ClassNotFound exception.  After changing the HADOOP_PREFIX to the one installed by gradlew, it proceeded to next... exception.  (Server is Ubuntu 12.04 provisioned using Vagrant, java is oracle JDK7). I'm going to try to reinstall Java.

Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /hadoop/lib/native/libhadoop.so.1.0.0 which might have disabled stack guard. The VM will try to fix the stack guard now.

It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.

14/07/23 08:54:35 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

Exception in thread "main" java.lang.NullPointerException

at java.lang.Class.isAssignableFrom(Native Method)

at org.apache.hadoop.conf.Configuration.setClass(Configuration.java:1968)

at org.apache.hadoop.mapreduce.Job.setOutputFormatClass(Job.java:823)

at com.mongodb.hadoop.util.MongoTool.runMapReduceJob(MongoTool.java:184)

at com.mongodb.hadoop.util.MongoTool.run(MongoTool.java:93)

at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)

at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:84)

at com.mongodb.hadoop.examples.treasury.TreasuryYieldXMLConfig.main(TreasuryYieldXMLConfig.java:52)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.apache.hadoop.util.RunJar.main(RunJar.java:212)



在 2014年7月22日星期二UTC+8下午8时37分16秒,Justin Lee写道:

TJ Tang

unread,
Jul 23, 2014, 5:47:26 AM7/23/14
to mongod...@googlegroups.com
Okay  I had to uncomment out this line in mongo-defaultx.xml

    <value>com.mongodb.hadoop.MongoOutputFormat</value>

Not sure why the default didn't work though. After this the hisotricalYield example succeeded.


在 2014年7月23日星期三UTC+8下午4时56分40秒,TJ Tang写道:

Justin Lee

unread,
Jul 23, 2014, 9:04:07 AM7/23/14
to mongod...@googlegroups.com
HADOOP_PREFIX definitely muddles things.  You should unset that in any shell you're running these samples in.  I just pushed a change that'll remove that env var for the execution of the samples.  Give that a try and see if that helps.

--------------------------------

name     : "Justin Lee", 
  title    : "Software Engineer",
  twitter  : "@evanchooly",
  web      : [ "10gen.com", "antwerkz.com" ],
  location : "New York, NY" }


Fabiola Rojo Orellana

unread,
Aug 9, 2014, 12:58:33 AM8/9/14
to mongod...@googlegroups.com
hi it me again :/

Nothing works for me.

Please, comment  the their versions of operating system and tools used.

I have worked with various versions and operating systems.

What is better, operating systems 32 or 64 bits?

Fabiola Rojo Orellana

unread,
Aug 18, 2014, 12:49:17 AM8/18/14
to mongod...@googlegroups.com
Hi, 

I'm trying to run the treasury yield example that brings the connector .... 
  now that was finally stopped running at 97% and does not advance (takes more than 12 hours so) 
Any help please !!!!! 
I really had a hard time this

This is all that show in the shell:

Justin Lee

unread,
Aug 18, 2014, 8:59:30 AM8/18/14
to mongod...@googlegroups.com
The samples should only take a few minutes each to run.  Check in build/logs and see if any errors occurred when trying to launch the hadoop cluster.

--------------------------------

name     : "Justin Lee", 
  title    : "Software Engineer",
  twitter  : "@evanchooly",
  web      : [ "10gen.com", "antwerkz.com" ],
  location : "New York, NY" }


--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
 
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
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 mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.

Fabiola Rojo Orellana

unread,
Aug 20, 2014, 12:44:54 PM8/20/14
to mongod...@googlegroups.com

I deleted all logs,
I ran the process again and checked each file. Only one had
output messages is the attachment.

help me please!!!
namenode-format.out

Justin Lee

unread,
Aug 20, 2014, 12:54:56 PM8/20/14
to mongod...@googlegroups.com
Are you on master when trying this?

--------------------------------

name     : "Justin Lee", 
  title    : "Software Engineer",
  twitter  : "@evanchooly",
  web      : [ "10gen.com", "antwerkz.com" ],
  location : "New York, NY" }


Fabiola Rojo Orellana

unread,
Aug 21, 2014, 10:53:43 AM8/21/14
to mongod...@googlegroups.com
Sorry but I do not know what you mean, mongo or hadoop ???
Reply all
Reply to author
Forward
0 new messages