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

Planner: a Solution with a @PlanningEntityCollectionProperty or @PlanningEntityProperty on a method that does not return a planning entity should fail with a decent error message.

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 5.4.0.Final
    • None
    • optaplanner-core
    • None

      "
      I accidently denoted the wrong class with the annotator
      @PlanningEntityCollectionProperty ; a class which was NOT a planning entity.
      Apparently, Drools Planner does not attempt to check for such a possibility,
      hence I get:

      Exception in thread "main" java.lang.NullPointerException
      	at
      org.drools.planner.core.domain.solution.SolutionDescriptor.getAllFacts(SolutionDescriptor.java:135)
      	at
      org.drools.planner.core.solution.director.DefaultSolutionDirector.getWorkingFacts(DefaultSolutionDirector.java:129)
      	at
      org.drools.planner.core.solution.director.DefaultSolutionDirector.resetWorkingMemory(DefaultSolutionDirector.java:123)
      	at
      org.drools.planner.core.solution.director.DefaultSolutionDirector.setWorkingSolution(DefaultSolutionDirector.java:97)
      	at
      org.drools.planner.core.solver.DefaultSolver.setPlanningProblem(DefaultSolver.java:97)
      	at in.co.technovia.examduties.ExamDutiesApp.main(ExamDutiesApp.java:47)
      

      Please check for such a possibility in future versions of Drools Planner and
      emit a more meaningful error message.
      "

              gdesmet@redhat.com Geoffrey De Smet (Inactive)
              gdesmet@redhat.com Geoffrey De Smet (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: