Announcement Announcement Module
Collapse
No announcement yet.
spring-data-mongdb dependency on spring-data-commons-core Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring-data-mongdb dependency on spring-data-commons-core

    I've been using spring-data-mongodb 1.0.0.M5, which depends on the nightly spring-data-commons-core build. It looks like the latest spring-data-commons-core build may have broken spring-data-mongodb. When I start up my webapp, my Repository classes now throw the following exception:

    Code:
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'widgetRepository': FactoryBean threw exception on object creation; nested exception is java.lang.NoSuchMethodError: org.springframework.data.repository.util.ClassUtils.getReturnedDomainClass(Ljava/lang/reflect/Method;)Ljava/lang/Class;
    	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)
    	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1429)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:844)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:786)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:703)
    	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:474)
    	... 57 more
    Caused by: java.lang.NoSuchMethodError: org.springframework.data.repository.util.ClassUtils.getReturnedDomainClass(Ljava/lang/reflect/Method;)Ljava/lang/Class;
    	at org.springframework.data.mongodb.repository.query.MongoQueryMethod.<init>(MongoQueryMethod.java:60)
    	at org.springframework.data.mongodb.repository.support.MongoRepositoryFactory$MongoQueryLookupStrategy.resolveQuery(MongoRepositoryFactory.java:120)
    	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:268)
    	at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:142)
    	at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:114)
    	at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.getObject(RepositoryFactoryBeanSupport.java:38)
    	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
    	... 65 more
    I'm using maven to build my app. My only spring-data dependency is:
    HTML Code:
            <dependency>
                <groupId>org.springframework.data</groupId>
                <artifactId>spring-data-mongodb</artifactId>
                <version>1.0.0.M5</version>
            </dependency>
    This ultimately picks up:

    spring-data-commons-core-1.2.0.BUILD-20111127.093221-152.jar
    spring-data-mongodb-1.0.0.M5.jar

    Anyone else seeing the same behavior?

  • #2
    Upon further inspection of https://github.com/SpringSource/spri...lassUtils.java, it's clear that the method getReturnedDomainClass was removed from ClassUtils.java on Nov 21. Meanwhile, https://github.com/SpringSource/spri...eryMethod.java was updated to reflect this change.

    However, the spring-data-mongodb POM for 1.0.0.M5 depends on the snapshot build of spring-data-commons-core. This is the fundamental problem now. The 1.0.0.M5 release should be pointed back at an older, pre-refactor version of commons-core or it will not be usable.

    I'm going to look into using snapshot builds of spring-data-mongodb as a workaround for myself.

    Comment


    • #3
      Looks like this was all caused by an unexpected default setting in my Intellij Maven plug-in. See https://jira.springsource.org/browse/DATAMONGO-327.

      Comment

      Working...
      X