Skip to content

Document limitations of using deferred JPA bootstrap and early access to JPA #24027

@Miicroo

Description

@Miicroo

Version: Spring Boot 2.3.x

Minimal example: Autowiring for instance an objectMapper into a custom AttributeConverter works fine with all versions of spring-boot v2.2.x. However, when upgrading to spring-boot 2.3.0 the objectMapper is no longer autowired and the application freezes indefinitely and doesn't start up.

Example of AttributeConverter:

@Component
public class StringListToJsonConverter implements AttributeConverter<List<String>, String> {

    private static ObjectMapper objectMapper;

    @Autowired
    public void init(ObjectMapper objectMapper) {
        this.objectMapper = objectMapper;
    }

    @Override
    public String convertToDatabaseColumn(List<String> documentObj) {
        // Do some logic...
    }

    @Override
    public List<String> convertToEntityAttribute(String documentStr) {
        // Do some logic...
    }
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions