object mapper conflict when importing springfox #890
Comments
You need to find where the second object mapper is coming from. Without looking at the configuration its hard to tell |
Yes I have got the second library fixed to do the autowiring by name and not type and now I am only facing issue with the HypermediaAutoConfiguration class |
@prabhat1790 have you found a resolution that you could perhaps share? |
Have made two changes for the resolution, made the hateoas object mapper as the primary bean - and set the order of the other bean to lowest precedence |
Hi All,
I am trying to configure springfox for my application and facing a issue related to _halObjectMapper bean. My application is getting one objectMapper bean from one library and one from springfox(or its dependencies) and therefore HypermediaAutoConfiguration class is unable to determine which bean to inject and throws up the exception -
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.hateoas.HypermediaAutoConfiguration$HypermediaConfiguration$HalObjectMapperConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.fasterxml.jackson.databind.ObjectMapper org.springframework.boot.autoconfigure.hateoas.HypermediaAutoConfiguration$HypermediaConfiguration$HalObjectMapperConfiguration.primaryObjectMapper; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [com.fasterxml.jackson.databind.ObjectMapper] is defined: expected single matching bean but found 2: enginesMapper,_halObjectMapper
Is it possible to configure this injection by name in place of by type to resolve the issue
The text was updated successfully, but these errors were encountered: