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
ModelMapper sometimes maps null values into fields randomly #580
Comments
I am facing the similar issue , issue gets fixed after i rerun the spring boot app 2.4.1 with java 8. i am using model mapper version 2.3.7. The issue is pretty inconsistent. |
Can you provide the reproducible code or model definitions? Thanks! |
@awaisazeem were you able to fix this? |
Any solution with this? I am facing similar issue |
这是来自QQ邮箱的假期自动回复邮件。
您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。
|
Same here - Spring Boot 2.5.14, ModelMapper 2.4.4, openjdk 11.0.18 Trying to post a reproducible, consistent case is nearly impossible. I know that doesn't help anything... But seems to be when mapping from a DTO (just an uuid for instance) to a Db Model - where the final output is expected to be a Db entity object with its nested/populated subobjects pointed to by the UUIDs in the DTO.... works 99% of the time. That 1% of the time, those would-be nested subobjects are come out of the mapping process as Restarting the app when in this failure mode, fixes the problem almost everytime. |
Actually this was my doing... we had a Bean for ModelMapper setup in Spring, and there was once place in the code that set config to STRICT thereby tarnishing that instance for the rest of the app's life in STRICT mode. STANDARD works all over now. |
Here is our model mapper configuration in our Spring Boot app. We use this integrated with jooq and we use the same mapper for non-jooq mappings as well.
We added the following logs:
and we got the following output:
Everything is somehow mapped to null. This happens pretty inconsistently and sometimes gets fixed just by rerunning the app. We're not really sure what's happening.
The text was updated successfully, but these errors were encountered: