3

Im building an application based on Spring Boot v1.2. While my application boots successfully and executes well (so far.. ), I'm unable to test using the spring boot framework because of an AbstractMethodError.

The last few lines of the trace are as below

Caused by: java.lang.AbstractMethodError: org.springframework.data.jpa.repository.support.LockModeRepositoryPostProcessor.postProcess(Lorg/springframework/aop/framework/ProxyFactory;Lorg/springframework/data/repository/core/RepositoryInformation;)V
    at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:185)
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:239)
    at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:225)
    at org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet(JpaRepositoryFactoryBean.java:84)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1627)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1564)
    ... 55 more

To analyze the above error, I checked the jar files from classpath involving the above classes. So the info is available as below

jar:file:/C:/rearch/intellij-workspace/springbootproj/lib/spring-aop-4.1.2.RELEASE.jar!/org/springframework/aop/framework/ProxyFactory.class
jar:file:/C:/rearch/mavenrepo/org/springframework/data/spring-data-commons/1.9.1.RELEASE/spring-data-commons-1.9.1.RELEASE.jar!/org/springframework/data/repository/core/RepositoryInformation.class
jar:file:/C:/rearch/intellij-workspace/springbootproj/lib/spring-data-jpa-1.3.3.jar!/org/springframework/data/jpa/repository/support/LockModeRepositoryPostProcessor.class
jar:file:/C:/rearch/intellij-workspace/springbootproj/lib/spring-test-4.1.2.RELEASE.jar!/org/springframework/test/context/support/DependencyInjectionTestExecutionListener.class

I'm not exactly sure on why spring-data-commons is coming up from maven repostory folder, while the others are being served from the project library.

While I debug that, I meanwhile need your help in figuring out the version compatibility between the above libraries. I wasnt able to exactly pin point on what exactly is causing the error. Please help!

Thanks

rakpan
  • 2,773
  • 4
  • 26
  • 36

3 Answers3

6

The issue was with the intellij configuration of libraries which conflicts with Spring boot application. I manually replaced the required libraries from Maven repository and that worked out for me.


Per request from Elron..

Open the project folder in explorer and verify if the third party library versions in your project matches the ones you actually expect it to be. If something doesnt match, just replace the file with the one you expect it to be. In my case, since I use Maven, I didnt see a need for explicitly saving those libraries in a new lib folder under the project. So, I just deleted all of the files inside the lib folder and things started working again.

rakpan
  • 2,773
  • 4
  • 26
  • 36
  • Hi, I have faced with the same issue, could you explain a little bit more about how you replaced which libraries ? – koders Feb 04 '15 at 09:17
  • Hi Elron, were you able to fix your error? If so, please give my answer a thumbs up! – rakpan Feb 06 '15 at 20:38
  • Yeah, sorry I have forgotten to comment. Thank you so much, actually I had switched to STS but I got it, now I can switch back to Idea again. – koders Feb 06 '15 at 22:50
2

For fix this error, change the spring-data-jpa version to 1.5.0.RELEASE

dmotta
  • 1,843
  • 2
  • 21
  • 32
0

I have faced this issue .

Get rid of spring-data-commons and change spring-data-jpa version to 1.9.0.RELEASE.

For more details , please follow this link :- Spring Data Rest PagingAndSortingRepository AbstractMethodError (RepositoryFactorySupport)

Community
  • 1
  • 1
Vijay
  • 4,694
  • 1
  • 30
  • 38