Setting up spring app with spring data repositories and mongo db

前端 未结 5 900
孤街浪徒
孤街浪徒 2021-01-06 04:09

I am facing an issue when defining mongo repository in application-context.xml

Following is the error i get in xml

Error occured process

5条回答
  •  攒了一身酷
    2021-01-06 04:36

    In my case it was spring data jpa version which was causing problem. I am not using spring data mongodb but spring data jpa instead. I started this projected today with latest versions (spring-framework 4.0.2.RELEASE, spring-data-jpa 1.5.0.RELEASE). I ensured that all transitive dependencies from maven (from spring side as well as from spring data side) are that of latest version but no lock.

    Following this thread, tried to downgrade spring version to 4.0.0.RELEASE but no luck. I even explored the org.springframework.context.annotation.AnnotationConfigUtils class from spring-context-4.0.2.RELEASE.jar (and also in spring-context-4.0.0.RELEASE.jar) from within my workspace and confirmed that indeed processCommonDefinitionAnnotations is a public method thus IllegalAccessError can not be an issue resulting from these jars.

    Finally I downgraded my spring-data-jpa from 1.5.0.RELEASE to 1.4.4.RELEASE and voila all problems are solved on maven update. I am using STS 3.4 if it helps anyone.

    Since this was the first post I found on googling this error, thought of posting it here so that others who are facing same problems can potentially solve it with this tip. I have opened bug report at https://jira.springsource.org/browse/DATAJPA-490

    @Oliver, tried the dependency management suggested but no luck. I have also added dependency:list output to the bug report as requested.

提交回复
热议问题