Results 1 to 2 of 2

Thread: Issue with calling a mapreduce in spring data mongo 1.0.3

  1. #1
    Join Date
    Nov 2006
    Posts
    8

    Default 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);

  2. #2
    Join Date
    Apr 2006
    Location
    Dresden, Germany
    Posts
    483

    Default

    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
  •