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

The MessageHistory header is not deserialized properly with the latest Spring Data #8983

Closed
artembilan opened this issue Mar 8, 2024 · 0 comments

Comments

@artembilan
Copy link
Member

The exception is like this:

2024-03-08 17:18:56,963 WARN [main] [org.springframework.integration.mongodb.store.MongoDbMessageStore] - Header 'history' could not be deserialized.
org.springframework.data.mapping.MappingException: No property components found on entity class org.springframework.integration.history.MessageHistory to bind constructor parameter to
	at org.springframework.data.mapping.model.PersistentEntityParameterValueProvider.getParameterValue(PersistentEntityParameterValueProvider.java:69) ~[spring-data-commons-3.3.0-SNAPSHOT.jar:3.3.0-SNAPSHOT]
	at org.springframework.data.mapping.model.ValueExpressionParameterValueProvider.getParameterValue(ValueExpressionParameterValueProvider.java:56) ~[spring-data-commons-3.3.0-SNAPSHOT.jar:3.3.0-SNAPSHOT]
	at org.springframework.data.mapping.model.ReflectionEntityInstantiator.createInstance(ReflectionEntityInstantiator.java:77) ~[spring-data-commons-3.3.0-SNAPSHOT.jar:3.3.0-SNAPSHOT]
	at org.springframework.data.mapping.model.ClassGeneratingEntityInstantiator.createInstance(ClassGeneratingEntityInstantiator.java:98) ~[spring-data-commons-3.3.0-SNAPSHOT.jar:3.3.0-SNAPSHOT]
	at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:535) ~[spring-data-mongodb-4.3.0-SNAPSHOT.jar:4.3.0-SNAPSHOT]
	at org.springframework.data.mongodb.core.convert.MappingMongoConverter.readDocument(MappingMongoConverter.java:503) ~[spring-data-mongodb-4.3.0-SNAPSHOT.jar:4.3.0-SNAPSHOT]
	at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:439) ~[spring-data-mongodb-4.3.0-SNAPSHOT.jar:4.3.0-SNAPSHOT]
	at org.springframework.integration.mongodb.store.MongoDbMessageStore$MessageReadingMongoConverter.read(MongoDbMessageStore.java:666) ~[classes/:?]

See more info in spring-projects/spring-data-commons#3056 and related PR: spring-projects/spring-data-commons#3059.

@artembilan artembilan added this to the 6.3.0-M2 milestone Mar 8, 2024
spring-builds pushed a commit that referenced this issue Mar 8, 2024
Fixes: #8983

Since collections in MongoDB cannot be deserialized to custom types anymore,
add a new `DocumentToMessageHistoryConverter` to convert the `Document` with `components`
into a `MessageHistory` instance back

(cherry picked from commit 809d139)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants