Announcement Announcement Module
Collapse
No announcement yet.
Data JPA + Data Mongo DB big problems Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Data JPA + Data Mongo DB big problems

    Hi, I am using these libraries in my project

    Code:
    		
                   <dependency>
    			<groupId>org.springframework.data</groupId>
    			<artifactId>spring-data-mongodb</artifactId>
    			<version>1.0.4.RELEASE</version>
    		</dependency>
    
    		<dependency>
    			<groupId>org.springframework.data</groupId>
    			<artifactId>spring-data-jpa</artifactId>
    			<version>1.0.3.RELEASE</version>
    		</dependency>
    My Repository is:

    Code:
    @Repository
    public interface JpaModelRepository extends JpaRepository<ModelEntity, Integer> {
    
    	//public ModelEntity findByName(String modelNameSample);
    }
    My Entity is:

    Code:
    @Entity
    @Table (name = "moto_model")
    public class ModelEntity implements GenericId<Integer>, Serializable {
    
            ...
    	@Column (name = "name_tx")
    	private String name;
            ...
    	public String getName() {
    		return name;
    	}
    
    	public void setName(String name) {
    		this.name = name;
    	}

    I am trying to define custom query findByName(...);

    When I un-comment that line in repository, I have this error in tomcat:

    Code:
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaModelRepository': FactoryBean threw exception on object creation; nested exception is java.lang.NoSuchMethodError: org.springframework.data.repository.query.parser.Part.getProperty()Lorg/springframework/data/repository/query/parser/Property;
    	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:1442)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:305)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:876)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:818)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:735)
    	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:478)
    	... 51 more
    Caused by: java.lang.NoSuchMethodError: org.springframework.data.repository.query.parser.Part.getProperty()Lorg/springframework/data/repository/query/parser/Property;
    	at org.springframework.data.jpa.repository.query.JpaQueryCreator.toPredicate(JpaQueryCreator.java:163)
    	at org.springframework.data.jpa.repository.query.JpaQueryCreator.create(JpaQueryCreator.java:95)
    	at org.springframework.data.jpa.repository.query.JpaQueryCreator.create(JpaQueryCreator.java:49)
    	at org.springframework.data.repository.query.parser.AbstractQueryCreator.createCriteria(AbstractQueryCreator.java:109)
    	at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:88)
    	at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:73)
    	at org.springframework.data.jpa.repository.query.PartTreeJpaQuery$QueryPreparer.<init>(PartTreeJpaQuery.java:102)
    	at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.<init>(PartTreeJpaQuery.java:59)
    	at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:93)
    	at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:71)
    	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:269)
    	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)
    	... 59 more
    To be honest I tried different versions of data-jpa and data-mongo libraries but I had other errors.

    My question is: what to do in order to fix my issue?

    Thank you,
    Mircea

  • #2
    On github, there is a project from Spring Data about multiple Spring Data modules in one project, and how you have to use tested combination of versions

    https://github.com/SpringSource/spri...ultistore-test

    Then look at the pom.xml to see the release profile to release combinations. there are others in the pom too.

    Mark

    Comment


    • #3
      Originally posted by bytor99999 View Post
      On github, there is a project from Spring Data about multiple Spring Data modules in one project, and how you have to use tested combination of versions

      https://github.com/SpringSource/spri...ultistore-test

      Then look at the pom.xml to see the release profile to release combinations. there are others in the pom too.

      Mark


      Thank you very much Mark. You pointed me on right direction.

      Comment


      • #4
        Generally the current milestone/release candidate releases are compatible already so that the next GAs will be.

        Comment

        Working...
        X