Skip to content

Spring boot: 3.2.0, Spring data Couchbase: 5.2.0: java.lang.IllegalArgumentException: Attribute of type java.util.Collections.SingletonList cannot be stored and must be converted. #1875

Closed
@ilangranet

Description

@ilangranet

Hi,

I am using Spring boot: 3.2.0 with Spring data Couchbase: 5.2.0

I have an entity defined with a field of type Object (this field can be everything (String or List...)):

public class Person {
    @NotNull
    @Id
    private String id;

    @NotNull
    @Field
    private String name;

    @Field
    private int age;

    @Field
    private Object myObject;
}

while trying to save it using this:
personRepository.save(new Person("1", "Alice", 25, Collections.singletonList("my issue")));

It failed on java.lang.IllegalArgumentException: Attribute of type java.util.Collections.SingletonList cannot be stored and must be converted.

it was working with previous version: Spring boot: 2.7.13, Spring data Couchbase: 4.4.13.
demo.zip

Find attached the project where it failed: to reproduce, run PersonRepositoryTest

Any suggestion?

Thank you

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions