1

I get the below error during deployment of a Spring web application.

java.lang.AbstractMethodError: org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$CreateIfNotFoundQueryLookupStrategy.resolveQuery(Ljava/lang/reflect/Method;Lorg/springframework/data/repository/core/RepositoryMetadata;Lorg/springframework/data/projection/ProjectionFactory;Lorg/springframework/data/repository/core/NamedQueries;)Lorg/springframework/data/repository/query/RepositoryQuery; at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1578) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:545) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE] 

The below link suggests to check compatibility between spring-data-commons and spring-data-jpa and it is fine.

Spring CrudRepository throws AbstractMethodError on custom query method definition

Could anything else create the issue ?

Below is my repository code

public interface MyRepository extends JpaRepository<MyEntityy, Long> 

i corrected the spring-data-commons to spring-data-commons-1.11.0.RELEASE and now I get a different error.

java.lang.AbstractMethodError: org.springframework.data.repository.core.support.RepositoryFactorySupport.getTargetRepository(Lorg/springframework/data/repository/core/RepositoryMetadata;)Ljava/lang/Object;; nested exception is org.springframework.beans.factory.BeanCreationException: 
7
  • how does your repository class look like? Commented Jun 8, 2017 at 11:45
  • its is simple class extending JPA Repository. Added the repository definition in the question Commented Jun 8, 2017 at 13:59
  • Did you follow the recommendation to make sure your dependencies are compatible with each other? Commented Jun 8, 2017 at 16:30
  • "compatibility between spring-data-commons and spring-data-jpa [..] is fine." - I doubt that. Please post the output of mvn dependency:dependency-tree -Dverbose or equivalent of the build tool you are using. Commented Jun 9, 2017 at 5:19
  • I am using spring-data-jpa-1.9.0.RELEASE and spring-data-common-1.12.0.RELEASE - Looks like these two are compatible. From where can i find out what is the compatible jar for spring-data-jpa-1.9.0.RELEASE Commented Jun 10, 2017 at 2:21

1 Answer 1

1

The issue was related to incompatibility between Spring-data-JPA and Spring-Data-Commons.

Spring-Data-JPA-1.9.0 is complaint with Spring-Data-Commons-1.11.0

My project had dependency to spring-data-elasticsearch which had pulled a different version of spring-data-commons - because of which I faced the above issue

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.