Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-2310

Native build: ChangeMoveSelectors are not being picked up by the optaplanner-quarkus extension

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • optaplanner-quarkus
    • None
    • Undefined
    • NEW
    • NEW

      Very similar to the issue regarding the VariableListeners https://issues.redhat.com/browse/PLANNER-2308, the ChangeMoveSelectors are not being picked up by the optaplanner-quarkus extension, and when the native image is generated the exception below is produced.

      Solver configuration

      <constructionHeuristic>
          <changeMoveSelector>  
       <filterClass>org.kie.kogito.taskassigning.core.model.solver.filter.TaskByGroupAndSkillsChangeMoveFilter</filterClass>
          </changeMoveSelector>
        </constructionHeuristic>
      

      The workaround is the same as the reported in https://issues.redhat.com/browse/PLANNER-2308, by decorating the TaskByGroupAndSkillsChangeMoveFilter with the @RegisterForReflection annotation.

      By extending the reasoning, the issue above will happen in general with whatever class instantiated by OptaPlanner using reflection that is not being properly picked up by the extension.

      2021-01-21 16:59:08,948 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-1) HTTP Request to /task-assigning/executeSolver failed, error id: d1552f5f-2a74-4248-b9a7-294cf9d4242b-2: org.jboss.resteasy.spi.UnhandledException: java.lang.IllegalArgumentException: The ChangeMoveSelectorConfig's filterClass (org.kie.kogito.taskassigning.core.model.solver.filter.TaskByGroupAndSkillsChangeMoveFilter) does not have a public no-arg constructor.
      	at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:106)
      	at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:372)
      	at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:218)
      	at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:519)
      	at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:261)
      	at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:161)
      
      

              cchianel Christopher Chianelli (Inactive)
              wmedvede@redhat.com Walter Medvedeo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: