Details
-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
None
-
None
-
-
NEW
-
NEW
Description
Hello,
I opened that StackOverflow question : https://stackoverflow.com/questions/70261160/optaplanner-spring-beancreationexception?noredirect=1#comment124221433_70261160
Long story short:
There are two modules, A and B, one module contains the @PlanningSolution class and the configuration files . The module B creates the solverConfig, solverFactory, scoreManager, etc. (referencing the needed classes from module A).
When creating a scoreManager (same for solverManager) from the instantiated SolverConfig (using config from module A) in module B, the following exception occurs :
nested exception is java.lang.IllegalStateException: The solutionClass (class be.my.domain.MySolution) has been specified as a solution in the configuration, but does not have a @PlanningSolution annotation.
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:627)
Note, be.my.domain.MySolution does have the correction annotation.
This will raise the mentioned exception.
The current workaround is to put the code from module A under module B, not ideal, but that works.
Note this bug showed up when we migrate Optaplanner from v7.28 to v8.13 (and now 8.14)