You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a JobStep to call other jobs, Spring batch persists the associated JobParameters in the BATCH_STEP_EXECUTION_CONTEXT table as a serialized object.
JobParameters is Serializable but does not set its SerialVersionUID. If I attempt to load an old job execution for a composite job ( for example through JobExplorer.getJobExecution()) and the JobParameter class has changed (for example when I update the version of the Spring Batch dependency) then I get the following error:
Caused by: java.io.InvalidClassException: org.springframework.batch.core.JobParameters; local class incompatible: stream classdesc serialVersionUID = -2301555723671712749, local class serialVersionUID = 9157654800004870848
at java.base/java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:597)
at java.base/java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:2051)
at java.base/java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1898)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2224)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1733)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:509)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:467)
at java.base/java.util.HashMap.readObject(HashMap.java:1552)
at java.base/jdk.internal.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at java.base/java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1100)
at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2423)
at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2257)
at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1733)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:509)
at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:467)
at org.springframework.batch.core.repository.dao.DefaultExecutionContextSerializer.deserialize(DefaultExecutionContextSerializer.java:81)
... 193 common frames omitted
Environment
Spring Batch 5.0.5
Java 17
Postgres bitnami/postgresql:13.10.0
Steps to reproduce
Run a Job containing a JobStep (which calls another job) on Spring Batch version 5.0.1
Update to Spring batch 5.0.5
Load the job using JobExplorer.getJobExecution()
Expected behavior
The job execution should be loaded from the database
The text was updated successfully, but these errors were encountered:
Bug description
When using a JobStep to call other jobs, Spring batch persists the associated JobParameters in the
BATCH_STEP_EXECUTION_CONTEXT
table as a serialized object.JobParameters is
Serializable
but does not set itsSerialVersionUID
. If I attempt to load an old job execution for a composite job ( for example throughJobExplorer.getJobExecution()
) and the JobParameter class has changed (for example when I update the version of the Spring Batch dependency) then I get the following error:Environment
Spring Batch 5.0.5
Java 17
Postgres bitnami/postgresql:13.10.0
Steps to reproduce
Run a Job containing a JobStep (which calls another job) on Spring Batch version 5.0.1
Update to Spring batch 5.0.5
Load the job using JobExplorer.getJobExecution()
Expected behavior
The job execution should be loaded from the database
The text was updated successfully, but these errors were encountered: