spring-projects / spring-data-mongodb

Provides support to increase developer productivity in Java when using MongoDB. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
https://spring.io/projects/spring-data-mongodb/
Apache License 2.0
1.61k stars 1.08k forks source link

Caused by: org.bson.codecs.configuration.CodecConfigurationException: The uuidRepresentation has not been specified, so the UUID cannot be encoded [DATAMONGO-2660] #3513

Closed spring-projects-issues closed 3 years ago

spring-projects-issues commented 3 years ago

Tom Jones opened DATAMONGO-2660 and commented

I'm trying to upgrade existing app from 

2.2.6.RELEASE

to 

2.3.6.RELEASE

 

Getting 

Caused by: org.bson.codecs.configuration.CodecConfigurationException: The uuidRepresentation has not been specified, so the UUID cannot be encoded.Caused by: org.bson.codecs.configuration.CodecConfigurationException: The uuidRepresentation has not been specified, so the UUID cannot be encoded. at org.bson.codecs.UuidCodec.encode(UuidCodec.java:72) at org.bson.codecs.UuidCodec.encode(UuidCodec.java:37) at org.bson.codecs.EncoderContext.encodeWithChildContext(EncoderContext.java:91) at org.bson.codecs.DocumentCodec.writeValue(DocumentCodec.java:198) at org.bson.codecs.DocumentCodec.writeMap(DocumentCodec.java:212) at org.bson.codecs.DocumentCodec.encode(DocumentCodec.java:154) at org.bson.codecs.DocumentCodec.encode(DocumentCodec.java:45) at org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:63) at org.bson.codecs.BsonDocumentWrapperCodec.encode(BsonDocumentWrapperCodec.java:29)

 

when running my CRUD tests for documents having UUID field.

Tried many things, nothing works, what is the right way to tell spring-boot

}}{{@Override public void configureClientSettings(MongoClientSettings.Builder builder) {    builder.uuidRepresentation(UuidRepresentation.STANDARD); }

 

to use correct uuid representation. Previous version just worked, why does update break it?


Affects: 3.0.5 (Neumann SR5)

spring-projects-issues commented 3 years ago

Christoph Strobl commented

Have you tried the spring.data.mongodb.uuid-representation property available in Spring Boot?

spring-projects-issues commented 3 years ago

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-projects-issues commented 3 years ago

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.