Results 1 to 2 of 2

Thread: spring data jpa + spring data mongo db

  1. #1
    Join Date
    Oct 2007
    Posts
    142

    Thumbs down spring data jpa + spring data mongo db

    Hi

    Are we supposed to use only one of these library or they can work together?

    After hours on the net it seems to that spring data jpa use an old version of spring data common but spring data mongodb is not compatible with that oldie.

    With this configuration
    Code:
    <dependency>
    			<groupId>org.springframework.data</groupId>
    			<artifactId>spring-data-jpa</artifactId>
    			<version>1.1.0.RC1</version>
    		</dependency>
    		<dependency>
    			<groupId>org.springframework.data</groupId>
    			<artifactId>spring-data-commons-core</artifactId>
    			<version>1.2.1.RELEASE</version>
    		</dependency>
    		<dependency>
    			<groupId>org.springframework.data</groupId>
    			<artifactId>spring-data-mongodb</artifactId>
    			<version>1.0.1.RELEASE</version>
    		</dependency>
    I get this error

    Code:
    java.lang.NoSuchMethodError: org.springframework.data.repository.query.ParametersParameterAccessor.hasBindableNullValue()Z
    	at org.springframework.data.jpa.repository.query.PartTreeJpaQuery$QueryPreparer.createQuery(PartTreeJpaQuery.java:114)
    	at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.doCreateQuery(PartTreeJpaQuery.java:71)
    	at org.springframework.data.jpa.repository.query.AbstractJpaQuery.createQuery(AbstractJpaQuery.java:144)
    	at org.springframework.data.jpa.repository.query.JpaQueryExecution$SingleEntityExecution.doExecute(JpaQueryExecution.java:121)
    	at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:56)
    	at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:95)
    	at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:85)
    Regards

  2. #2
    Join Date
    Mar 2012
    Posts
    1

    Default

    spring-data-jpa 1.1.0.RC1 depends on spring-data-commons-core 1.3.0.M1 per it's pom.xml file:
    http://repo.springsource.org/libs-mi...-1.1.0.RC1.pom

    spring-data-mongo 1.0.1.RELEASE however depends on spring-data-commons-core 1.2.1.RELEASE - see:
    http://repo.springsource.org/libs-mi....1.RELEASE.pom

    In STS, if you open your project's pom.xml file and go to the Dependency Hierarchy, you can see which dependencies are "omitted" for various reasons. If you've got one that's less than the dependent version, you run into problems.

    So, it seems if you want to use spring-data-jpa 1.1.0.RC1 you'll have to use spring-data-mongo 1.1.0.M1 as they both require spring-data-commons-core version 1.3.X Alternatively, you could drop both back to the 1.0.X versions which both require spring-data-commons-core version 1.2.X Either way, you should remove the spring-data-commons-core dependency from your pom.xml so that maven handles it for you.

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
  •