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

MappingMongoConverter fails to properly read nested arrays [DATAMONGO-1904] #2805

Closed
spring-projects-issues opened this issue Mar 15, 2018 · 4 comments
Assignees

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Mar 15, 2018

Martin Rauscher opened DATAMONGO-1904 and commented

I have a @Document with a field of type float [] [] []. Since upgrading to Spring Boot 2 from 1.5.3, this is broken with this exception.

Caused by: org.springframework.data.mapping.MappingException: Cannot convert [10.250009536743164, 48.43263626098633] of type class java.util.ArrayList into an instance of class java.lang.Object! Implement a custom Converter<class java.util.ArrayList, class java.lang.Object> and register it with the CustomConversions. Parent object was: .......

Looking at your source at
https://github.com/spring-projects/spring-data-mongodb/blame/master/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MappingMongoConverter.java#L985

I wonder how this could ever work...


Affects: 2.1 M1 (Lovelace), 2.0.5 (Kay SR5)

Backported to: 2.0.6 (Kay SR6)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Mar 15, 2018

Oliver Drotbohm commented

Would you mind adding a bit more details? A stack trace would help as well as the domain type you're trying to map and the source document?

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Mar 15, 2018

Oliver Drotbohm commented

Nevermind, I could reproduce the issue. Handing the component type down the conversion instead of ClassTypeInformation.OBJECT should fix this

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Mar 16, 2018

Oliver Drotbohm commented

That should be fixed. Feel free to give the snapshots a try

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Mar 20, 2018

Martin Rauscher commented

Thanks, looking good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants