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

[Bug] jackson #3854

Open
niuhutao opened this issue Nov 20, 2024 · 3 comments
Open

[Bug] jackson #3854

niuhutao opened this issue Nov 20, 2024 · 3 comments

Comments

@niuhutao
Copy link

spring boot 3.3.4
SBA 3.3.6

When there is a custom objectmapper in the application, the SBA serialization error will be reported, if the SBA uses special serialization rules, why not build its own objectmapper inside the SBA. Good components should be compatible and fault-tolerant, but SBA has so far been too difficult to use in complex projects

@niuhutao
Copy link
Author

Add a little more
I added a special objectmapper in MappingJackson2HttpMessageConverter

@SteKoe
Copy link
Contributor

SteKoe commented Nov 20, 2024

Hi @niuhutao,

Spring Boot 3 has implemented an isolated object mapper as the docs say :

Responses from the actuator endpoints shipped with Spring Boot 3 now use an isolated ObjectMapper instance to ensure results are consistent.

As long as you do not change the behavior of the isolated object mapper, we are safe and good to go here.

@erikpetzold
Copy link
Member

erikpetzold commented Nov 22, 2024

@niuhutao as @SteKoe wrote, Spring Boot 3 provides a separate ObjectMapper for actuator endpoints. This makes sure that you do not change the actuator output by accident.

I guess you have completely overridden the mechanism in your MappingJackson2HttpMessageConverter. This one extends AbstractJackson2HttpMessageConverter and there is a Map with objectMapperRegistrations, probably you should have placed your own ObjectMapper in this Map instead of overriding everything.

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

No branches or pull requests

3 participants