3

Using Optaplanner 8.6.0.Final, Quarkus 1.13.4.Final

I have built a custom phase using the CustomPhaseCommand interface:

@RegisterForReflection
public class InitPhase implements CustomPhaseCommand<Schedule> {
   ...
}

It is configured like this in solverConfig.xml:

<customPhase>
    <customPhaseCommandClass>org.acme.InitPhase</customPhaseCommandClass>
</customPhase>

But when running the native build it fails at startup:

ERROR [io.qua.run.Application] (main) Failed to start application (with profile prod): java.lang.IllegalArgumentException: Impossible state: could not find the CustomPhaseConfig's customPhaseCommandClass (org.acme.InitPhase) generated Gizmo supplier.
    at org.optaplanner.core.config.util.ConfigUtils.newInstance(ConfigUtils.java:34)
    at io.quarkus.runtime.Quarkus.run(Quarkus.java:119)
    at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:29)
    at org.optaplanner.core.impl.phase.custom.DefaultCustomPhaseFactory.createCustomPhaseCommand(DefaultCustomPhaseFactory.java:69)

    at org.optaplanner.core.impl.phase.custom.DefaultCustomPhaseFactory.buildPhase(DefaultCustomPhaseFactory.java:53)
    at org.optaplanner.core.impl.phase.custom.DefaultCustomPhaseFactory.buildPhase(DefaultCustomPhaseFactory.java:31)
    at org.optaplanner.core.impl.solver.DefaultSolverFactory.buildPhaseList(DefaultSolverFactory.java:177)
    at org.optaplanner.core.impl.solver.DefaultSolverFactory.buildSolver(DefaultSolverFactory.java:99)
    at org.optaplanner.core.impl.solver.DefaultSolverManager.validateSolverFactory(DefaultSolverManager.java:68)
    at org.optaplanner.core.impl.solver.DefaultSolverManager.<init>(DefaultSolverManager.java:57)
    at org.optaplanner.core.api.solver.SolverManager.create(SolverManager.java:111)

Can I generate the Gizmo supplier manually somehow? It all works just fine when not running it native.

Geoffrey De Smet
  • 26,223
  • 11
  • 73
  • 120
Magnus Våge
  • 305
  • 3
  • 12

0 Answers0