optaplannertimefold

Move from Optaplanner to Timefold results in Spring error


We have a scheduling application that is built on Optaplanner (9.42).

I wanted to try it with Timefold and used the Maven upgrade CLI command.

This part of the change worked without errors and I can even compile the project.

However, when starting the application I receive the following error

Receiver class ai.timefold.solver.spring.boot.autoconfigure.TimefoldSolverAutoConfiguration does not define or inherit an implementation of the resolved method 'abstract void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory)' of interface org.springframework.beans.factory.config.BeanFactoryPostProcessor.

After the change to Timefold the pom.xml has the following versions in it

<version.ai.timefold.solver>1.16.0</version.ai.timefold.solver>
<version.org.springframework.boot>3.0.7</version.org.springframework.boot>

Which package do I need to upgrade to which version, to fix this error?


Solution

  • This is an issue with the older Spring version. It was fixed in Spring 6.1 (Spring Boot 3.2+) see: https://github.com/spring-projects/spring-framework/issues/31476.

    Updating your Spring Boot version to something higher than 3.2.x should work. The migration script for Timefold doesn't touch your Spring Boot Version.