spring-bootkotlinschedulingjobrunr

JobRunr one of the JobParameters is not deserializable anymore


Been using JobRunr (7.4.1) in my Kotlin-based Spring Boot (3.4.3) app, where I am enqueuing jobs like this

jobScheduler.enqueue { serviceA.doSomething() }

and recently refactored the target service, so now the above service has been removed and replaced by another one, so the calls now look like this

jobScheduler.enqueue { serviceB.doSomethingElse() }

This now raises the following errors in the logs

Trying to find Job Annotations for 'org.example.ServiceA.doSomething(org.jobrunr.jobs.JobParameterNotDeserializableException)' but the class could not be found. The Job name and other properties like retries and labels will not be set on the Job.
org.jobrunr.scheduling.exceptions.JobClassNotFoundException: org.example.ServiceA.doSomething(org.example.ParameterA)
caused by: one of the JobParameters is not deserializable anymore

This puzzles me, because I thought these jobs are fire-and-forget, other than recurring jobs. So what is the best way to resolve this?

Edit: the warning does not only relate to the component, but also the method parameter - a class that has also been refactored. It looks like new jobs are correctly enqueued, but the warning regularly pops up.


Solution

  • This error may be logged when SUCCEEDED jobs are moving to DELETED state. JobRunr tries to lookup some info on the Job via the @Job annotation and as it is not there anymore, logs this error.

    This will not interfere with JobRunr processing (or we are missing an integration test ☺️).