Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


Here is the sample code. Error is on Line 3.

1   BasicDBObject dbo=new BasicDBObject(data);
2   DBCollection coll = new Mongo().getDB("test")
4   data.put(Entity.DB_ID, dbo.get(Entity.DB_ID));

Strangely, this error is showing when running as webapp from Tomcat6 and using mongo 2.4 or 2.5.3. With 2.0.rc3, it works fine. I want to use 2.5.3 Also, when runing from eclipse, or commandline, it works with all the three versions(2.0 ,2.4, 2.5.3) And the DBCollection class is being loaded because coll.insert(), coll.find() are working. Just that it is saying NoSuchMethodError when I call save().

This is a fresh install of Ubuntu 10.4 and tomcat6 on top of it. The JDK is OpenJDK java version "1.6.0_20" OpenJDK Runtime Environment (IcedTea6 1.9.7) (6b20-1.9.7-0ubuntu1~10.04.1)

share|improve this question

Sounds like you need to recompile here and make sure you targets are clean, if there were conlicting mongo jar files from different versions in the class path then a change in the moethod return (which I think there is in 2.0 --> 2.5) would cause this kind of problem.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.