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

Problem with muliple ObjectMapper and WebFluxHateoasConfiguration.HypermediaWebFluxConfigurer.hypermediaWebFluxConfigurer(...) #2273

Open
pblanche opened this issue Dec 19, 2024 · 0 comments

Comments

@pblanche
Copy link

We have to deal with multiple named ObjectMappers in our Application.
Using @EnableHypermediaSupport(type = EnableHypermediaSupport.HypermediaType.HAL) leads to the following Exception:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hypermediaWebFluxConfigurer' defined in class path resource [org/springframework/hateoas/config/WebFluxHateoasConfiguration.class]: Failed to instantiate [org.springframework.hateoas.config.WebFluxHateoasConfiguration$HypermediaWebFluxConfigurer]: Factory method 'hypermediaWebFluxConfigurer' threw exception with message: No qualifying bean of type 'com.fasterxml.jackson.databind.ObjectMapper' available: expected single matching bean but found 2: customizedObjectMapperAAA,customizedObjectMapperBBB

I did not find a possibility to hook into the configuration to use a specific ObjectMapper. The only way to workaround this problem is to use the @Primary annotation to select the preferred ObjectMapper bean.
Is there a way to configure the ObjectMapper? If not it would be nice to have such a possibility to do so.

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

No branches or pull requests

1 participant