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

Execution context deserialization failure in AOT mode on second job run #4239

Closed
goafabric opened this issue Nov 18, 2022 · 1 comment
Closed
Labels
has: minimal-example Bug reports that provide a minimal complete reproducible example in: core related-to: native type: bug
Milestone

Comments

@goafabric
Copy link

While Spring Batch AOT in Spring Boot 3.0 already works mostly fine,
there seems to be a small problem when a job is run for the 2nd time.
The deserialisation of the executioncontext crashes.
I already tried to set hints for java.util.hashmap .. but i guess the root cause is somewhere else.

Attached are the error and an example project that works in normal mode but crahses in AOT.

Could be that this is already fixed, but at least for me latest Spring Boot 3.0 RC2 + SNAPSHOT caused the error

error.txt
Archiv.zip

@goafabric goafabric added status: waiting-for-triage Issues that we did not analyse yet type: bug labels Nov 18, 2022
@fmbenhassine fmbenhassine added in: core related-to: native and removed status: waiting-for-triage Issues that we did not analyse yet labels Nov 22, 2022
@fmbenhassine fmbenhassine added this to the 5.0.0 milestone Nov 22, 2022
@fmbenhassine fmbenhassine added the has: minimal-example Bug reports that provide a minimal complete reproducible example label Nov 22, 2022
@fmbenhassine
Copy link
Contributor

Thank you for reporting this issue! Indeed, the second run fails when trying to deserialize the execution context.

I don't see what could be done on Spring Batch's side other than adding a serializtion hint for HashMap and other basic types that are required for the serialization/deserialization of the execution context to work out-of-the box.

FTR, I had to add a serilazation hint for java.lang.Integer, java.lang.Number and java.lang.String for the attached sample to work. I think basic Java types should be provided by default to avoid asking users to add them manually.

For custom user types however, I believe it is reasonable for now to ask users to hint them if necessary (unless there is a way to make Spring Batch infer them somehow and add hints for them on the fly, but I'm not sure if this is even possible).

#4239 partially resolves the issue. It will be merged and completed with other basic types as mentioned previously.

@fmbenhassine fmbenhassine changed the title #aot build crashes on 2nd job run Execution context deserialization failure in AOT mode on second job run Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has: minimal-example Bug reports that provide a minimal complete reproducible example in: core related-to: native type: bug
Projects
None yet
Development

No branches or pull requests

2 participants