Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setMongoOperations in MongoRepositoryFactoryBean calls for invalid method setMappingContext [DATAMONGO-716] #1645

Closed
spring-projects-issues opened this issue Jul 8, 2013 · 9 comments
Assignees
Labels
in: core in: repository type: bug

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Jul 8, 2013

Triguna Mutuguppe Sripathi opened DATAMONGO-716 and commented

When I run Spring Data MongoDB 1.2.1, I found the code throwing following exception stack:

Caused by: org.springframework.beans.PropertyBatchUpdateException: Failed properties: Property 'mongoOperations' threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.data.mongodb.repository.support.MongoRepositoryFactoryBean.setMappingContext(Lorg/springframework/data/mapping/context/MappingContext;)V

Detail stack trace is attached.

After analyzing the code: org.springframework.data.mongodb.repository.support.MongoRepositoryFactoryBean, setMongoOperations(…) references to setMappingContext(…) which does not exist in the same class or super class which is causing the problem.

This has stopped me to work further in the project. Please fix it asap. This is a code review bug


Affects: 1.2.1

Attachments:

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jul 8, 2013

Oliver Drotbohm commented

As the pom.xml of Spring Data MongoDB suggests, it requires a Spring Data Commons of the 1.5.x generation. Please make sure you have e.g. SD Commons 1.5.1 in your classpath

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jul 9, 2013

Triguna Mutuguppe Sripathi commented

Wow... I had a spring-data-jpa from the previous project which caused the problem.
Like you mentioned, I had two jars which was referencing SD Commons one of them was 1.4.0.jar (SD Commons Core) and both the jar files were available in the classpath.

This issue is resolved as soon as I removed spring-data-jpa. Thanks.

PS: This issue was never mentioned in any of the forums or jira, so I had to raise the issue apologies...

Thanks for your help Oliver. It was real quick and thoughtful.
Triguna

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jul 9, 2013

Oliver Drotbohm commented

We've moved to the notion of a release train since two major releases. Currently the roadmap is maintained in the Spring Data Commons' wiki. You find a list of compatible versions here (in case you still need to work with both the Mongo and the JPA module). I'll go ahead and add the necessary info to the project's websites

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jul 9, 2013

Triguna Mutuguppe Sripathi commented

Oliver Gierke, yes that would be great. We might plan to work both of them together... However just a question, if I exclude sd-commons-core jar file from pom.xml for JPA will my JPA-Hibernate-Jdbc code work? (I doubt)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jul 9, 2013

Oliver Drotbohm commented

You shouldn't need to exclude anything. Simply include the matching versions stated in the document I linked

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jul 9, 2013

Triguna Mutuguppe Sripathi commented

What I mean is, spring-data-jpa needs spring-data-commons-core for which the latest version is 1.4.1.RELEASE and spring-data-mongo needs spring-data-commons for which the latest version is 1.5.1.RELEASE.

That is the reason I mentioned the spring-data-jpa one to exclude spring-data-commons-core (when we plan to use both jpa and mongo) and will it uses whatever classes available in the classpath? (I mean is the packages in both jar files same?)

if we plan to use both jpa-hibernate and jpa-mongo, what would be the ideal scenario in the above case I have mentioned in this comment?

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jul 9, 2013

Oliver Drotbohm commented

No, please read the links carefully. If you want to use SD MongoDB in 1.2.1 you're in the Arora release train. According to the web page I linked, the release train includes SD JPA 1.3.2 and SD Commons in 1.5.1. If you use these versions, they will work together smoothly

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jul 9, 2013

Oliver Drotbohm commented

Going forward, for general questions, please use the forums

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jul 9, 2013

Triguna Mutuguppe Sripathi commented

Thanks for your help on this one

@spring-projects-issues spring-projects-issues added type: bug in: repository in: core labels Dec 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core in: repository type: bug
Projects
None yet
Development

No branches or pull requests

2 participants