Announcement Announcement Module
Collapse
No announcement yet.
spring data jpa + spring data mongo db Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.

    Comment

    Working...
    X