One Star

Can't get tMongoDBConnection component to work!

I created a VERY simple job in TOS (v4.2). The only component loaded into the design area is tMongoDBConnection. I made sure that I was pointed at "localhost" and at the DB called "test".
When I try to run the job, I get the "NoClassDefFoundError" error listed below.
I have tried the following:
1) placed tMongoDBConnection folder from ZIP file in C:\Talend\TOS-Win32-r63143-V4.2.2\plugins\org.talend.designer.components.localprovider_4.2.2.r63143\components
2) When I had initially added the component, I was getting compile errors; so, I added the mongo-1.3.jar file as an external jar to the list and the compile errors went away.
3) copied the mongo-1.3.jar file to C:\Talend\TOS-Win32-r63143-V4.2.2\lib\java
4) copied the mongo-1.3.jar file to C:\Talend\TOS-Win32-r63143-V4.2.2\plugins
5) created a classpath variable via Prefs > Java > Build Path
6) verified that an entry for the jar was in the C:\Talend\TOS-Win32-r63143-V4.2.2\workspace\.Java\.classpath file
I don't know what else to do!!! maybe the component is buggy???
==========================================================
ERROR MESSAGE STARTS HERE
==========================================================
Starting job mongodb_test at 19:18 18/08/2011.
connecting to socket on port 3775
connected
Exception in thread "main" java.lang.Error: java.lang.NoClassDefFoundError: com/mongodb/Mongo
at emdeon_sample_data.mongodb_test_0_1.mongodb_test.tMongoDBConnection_1Process(mongodb_test.java:286)
at emdeon_sample_data.mongodb_test_0_1.mongodb_test.runJobInTOS(mongodb_test.java:457)
at emdeon_sample_data.mongodb_test_0_1.mongodb_test.main(mongodb_test.java:331)
Caused by: java.lang.NoClassDefFoundError: com/mongodb/Mongo
at emdeon_sample_data.mongodb_test_0_1.mongodb_test.tMongoDBConnection_1Process(mongodb_test.java:240)
disconnected
... 2 more
Caused by: java.lang.ClassNotFoundException: com.mongodb.Mongo
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 3 more
Job mongodb_test ended at 19:18 18/08/2011.
6 REPLIES
Community Manager

Re: Can't get tMongoDBConnection component to work!

Hi
I can't reproduce the problem, I did not get any compile error when I install the component into TOS studio.
Best regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Can't get tMongoDBConnection component to work!

I appreciate the quick response.
Then what could I have done wrong???
If you don't mind sharing, exactly what steps did you follow to download and install the component?
As I mentioned, I couldn't get the component working initially when I simply downloaded it and put it into the "C:\Talend\TOS-Win32-r63143-V4.2.2\plugins\org.talend.designer.components.localprovider_4.2.2.r63143\components" folder (is that the right place to put it?). I was getting compilation errors; so, that's when I started messing around with class paths and what not just to get the compile errors to go away. I just can't get past the "NoClassDefFoundError" error to be able to run the job (is there an alternative to load a component or a required JAR at runtime?)
If you could list out the steps you had followed, at least I could uninstall TOS and start all over again following your steps and maybe things might work correctly. I can document everything I did and include screenshots in a zip file so you can see what I saw.
One Star

Re: Can't get tMongoDBConnection component to work!

I am really stuck!!! I need to be able to load data into MongoDB and I can NOT get this working!!!
Employee

Re: Can't get tMongoDBConnection component to work!

Carl,
Did you ever resolve this issue? I'm facing the same problem...
Thanks,
Darren
One Star

Re: Can't get tMongoDBConnection component to work!

I've installed tMongoDBConnection and tMongoDBInput, and created a simple job.
But both components are giving the error "Module mongo-1.3.jar required"
This file (mongo-1.3.jar) is included in each component's folder, but Talend seems to not find the file.
What can be done?
One Star

Re: Can't get tMongoDBConnection component to work!

Can any body confirm that the steps Carl Singer (csinger) is describing is the proper way to get the MongoDB-components in and running?
Or is there something missing or should be done differently?
----
1) placed tMongoDBConnection folder from ZIP file in C:\Talend\TOS-Win32-r63143-V4.2.2\plugins\org.talend.designer.components.localprovider_4.2.2.r63143\components
2) When I had initially added the component, I was getting compile errors; so, I added the mongo-1.3.jar file as an external jar to the list and the compile errors went away.
3) copied the mongo-1.3.jar file to C:\Talend\TOS-Win32-r63143-V4.2.2\lib\java
4) copied the mongo-1.3.jar file to C:\Talend\TOS-Win32-r63143-V4.2.2\plugins
5) created a classpath variable via Prefs > Java > Build Path
6) verified that an entry for the jar was in the C:\Talend\TOS-Win32-r63143-V4.2.2\workspace\.Java\.classpath file
----