-
Jul 30th, 2012, 06:55 PM
#1
Issue with calling a mapreduce in spring data mongo 1.0.3
Hey All I am trying to call the sample map reduce found on mongodb's site
I get the following error with Java driver 2.7.1 and spring data 1.0.3-RELEASE
DEBUG] [main 07:36:06] (MongoTemplate.java:mapReduce:997) Executing MapReduce on collection [testit], mapFunction [function () {
for (var i = 0; i < this.x.length; i++) {
emit(this.x[i], 1);
}
}
], reduceFunction [function (key, values) {
var sum = 0;
for (var i = 0; i < values.length; i++)
sum += values[i];
return sum;
}]
Exception in thread "main" java.lang.NoSuchMethodError: com.mongodb.DB.getOptions()I
at org.springframework.data.mongodb.core.MongoTemplat e.mapReduce(MongoTemplate.java:1009)
at org.springframework.data.mongodb.core.MongoTemplat e.mapReduce(MongoTemplate.java:971)
The line in quesition is
CommandResult commandResult = command.getOutputType() == MapReduceCommand.OutputType.INLINE ? executeCommand(commandObject, getDb().getOptions()) : executeCommand(commandObject);
-
Jul 31st, 2012, 06:48 AM
#2
Please check your dependency setup. 2.7.1 of the MongoDB Java driver definitely has the getOptions() method so you probably have an older version on the classpath.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules