Announcement Announcement Module
Collapse
No announcement yet.
NoSuchMethodError: Using spring-data-mongodb (version 1.1.1) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • NoSuchMethodError: Using spring-data-mongodb (version 1.1.1)

    Here are the dependencies:
    Code:
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-mongodb</artifactId>
        <version>1.1.1.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-jpa</artifactId>
        <version>1.3.0.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>4.1.10.Final</version>
    
    </dependency>

    Code:
    java.lang.NoSuchMethodError: org.springframework.data.mapping.model.PersistentEntityParameterValueProvider.setSpELEvaluator(Lorg/springframework/data/mapping/model/SpELExpressionEvaluator;)V
        at org.springframework.data.mongodb.core.convert.MappingMongoConverter.getParameterProvider(MappingMongoConverter.java:218) [spring-data-mongodb-1.1.1.RELEASE.jar:]
        at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:227) [spring-data-mongodb-1.1.1.RELEASE.jar:]
        at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:209) [spring-data-mongodb-1.1.1.RELEASE.jar:]
        at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:173) [spring-data-mongodb-1.1.1.RELEASE.jar:]
        at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:169) [spring-data-mongodb-1.1.1.RELEASE.jar:]
        at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:72) [spring-data-mongodb-1.1.1.RELEASE.jar:]
        at org.springframework.data.mongodb.core.MongoTemplate$ReadDbObjectCallback.doWith(MongoTemplate.java:1820) [spring-data-mongodb-1.1.1.RELEASE.jar:]
        at org.springframework.data.mongodb.core.MongoTemplate.executeFindOneInternal(MongoTemplate.java:1503) [spring-data-mongodb-1.1.1.RELEASE.jar:]
        at org.springframework.data.mongodb.core.MongoTemplate.doFindOne(MongoTemplate.java:1309) [spring-data-mongodb-1.1.1.RELEASE.jar:]
        at org.springframework.data.mongodb.core.MongoTemplate.findById(MongoTemplate.java:516) [spring-data-mongodb-1.1.1.RELEASE.jar:]
        at org.springframework.data.mongodb.core.MongoTemplate.findById(MongoTemplate.java:509) [spring-data-mongodb-1.1.1.RELEASE.jar:]

  • #2
    Fixed!

    Updating the spring-data-mongodb dependency from version 1.1.1 to 1.2.1 fixed it.
    Code:
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-mongodb</artifactId>
        <version>1.2.1.RELEASE</version>
    </dependency>

    Comment


    • #3
      [update: I was working on my response, got interrupted, and didn't see that you had already posted a fix which confirms my guess]

      Just a quick guess ... you may have a version mismatch since you are specifying an older version of Spring Data Commons in your Spring Data Mongodb than in your Spring Data JPA version. Perhaps the POM editor's "Dependency Hierarchy" tab shows omitted versions?

      In a sample project I just set up, I see


      spring-data-commons: 1.5.0.RELEASE [compile]
      spring-data-commons-core: 1.4.0.RELEASE [compile]


      That seems to be a significant conflict to me.

      Try

      Code:
      <dependency>
       <groupId>org.springframework.data</groupId>
       <artifactId>spring-data-mongodb</artifactId>
       <version>1.2.1.RELEASE</version>
      </dependency>
      With this setting, the spring-data-commons-core dependency disappears. I would even change the Spring Data JPA version to 1.3.1.RELEASE in order to eliminate all omissions and potential conflicts.

      However, like I said, I'm just guessing.
      Last edited by pfurbacher; Jun 10th, 2013, 12:07 PM.

      Comment

      Working...
      X