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

NullPointerException in Drools AbstractRuleContext for DroolsConstraintStreamScoreDirector

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 8.23.0.Final
    • None
    • optaplanner-core
    • None
    • NEW
    • NEW

      Reported by 2 different users:

      Only when moveThreadCount != NONE. The stacktrace is different but does look to have a similar cause.

      [ERROR] [pool-410-thread-1] [or.op.co.im.so.DefaultSolverManager] [] Solving failed for problemId (18bac18d-b240-494d-86b9-2df9ddba153b).: java.lang.IllegalStateException: The move thread with moveThreadIndex (0) has thrown an exception. Relayed here in the parent thread.
          at org.optaplanner.core.impl.heuristic.thread.OrderByMoveIndexBlockingQueue.take(OrderByMoveIndexBlockingQueue.java:147)
          at org.optaplanner.core.impl.constructionheuristic.decider.MultiThreadedConstructionHeuristicDecider.forageResult(MultiThreadedConstructionHeuristicDecider.java:193)
          at org.optaplanner.core.impl.constructionheuristic.decider.MultiThreadedConstructionHeuristicDecider.decideNextStep(MultiThreadedConstructionHeuristicDecider.java:158)
          at org.optaplanner.core.impl.constructionheuristic.DefaultConstructionHeuristicPhase.solve(DefaultConstructionHeuristicPhase.java:64)
          at org.optaplanner.core.impl.solver.AbstractSolver.runPhases(AbstractSolver.java:99)
          at org.optaplanner.core.impl.solver.DefaultSolver.solve(DefaultSolver.java:209)
          at org.optaplanner.core.impl.solver.DefaultSolverJob.call(DefaultSolverJob.java:121)
          at java.util.concurrent.FutureTask.run(FutureTask.java:264)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
          at java.lang.Thread.run(Thread.java:829)
          at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:597)
          at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:194)
      Caused by: Exception executing consequence for rule "Some rule name" in package.of.rule.in.constraint.provider: java.lang.NullPointerException
          at org.drools.wiring.statics.StaticComponentsSupplier$StaticConsequenceExceptionHandler.handleException(StaticComponentsSupplier.java:81)
          at org.drools.kiesession.agenda.DefaultAgenda.handleException(DefaultAgenda.java:935)
          at org.drools.core.phreak.RuleExecutor.innerFireActivation(RuleExecutor.java:460)
          at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:101)
          at org.drools.core.concurrent.AbstractRuleEvaluator.internalEvaluateAndFire(AbstractRuleEvaluator.java:33)
          at org.drools.core.concurrent.SequentialRuleEvaluator.evaluateAndFire(SequentialRuleEvaluator.java:43)
          at org.drools.kiesession.agenda.DefaultAgenda.fireLoop(DefaultAgenda.java:748)
          at org.drools.kiesession.agenda.DefaultAgenda.internalFireAllRules(DefaultAgenda.java:695)
          at org.drools.kiesession.agenda.DefaultAgenda.fireAllRules(DefaultAgenda.java:687)
          at org.drools.kiesession.session.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1092)
          at org.drools.kiesession.session.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1083)
          at org.drools.kiesession.session.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1075)
          at org.optaplanner.constraint.streams.drools.DroolsConstraintStreamScoreDirector.calculateScore(DroolsConstraintStreamScoreDirector.java:85)
          at org.optaplanner.core.impl.score.director.AbstractScoreDirector.doAndProcessMove(AbstractScoreDirector.java:222)
          at org.optaplanner.core.impl.heuristic.thread.MoveThreadRunner.run(MoveThreadRunner.java:147)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
          ... 6 more
      Caused by: java.lang.NullPointerException
          at org.optaplanner.constraint.streams.drools.common.AbstractRuleContext.runConsequence(AbstractRuleContext.java:58)
          at org.optaplanner.constraint.streams.drools.common.UniRuleContext.lambda$newRuleBuilder$f02e01a4$1(UniRuleContext.java:52)
          at org.drools.model.functions.Block3$Impl.execute(Block3.java:40)
          at org.drools.modelcompiler.consequence.LambdaConsequence.evaluate(LambdaConsequence.java:76)
          at org.drools.core.phreak.RuleExecutor.innerFireActivation(RuleExecutor.java:454)
          ... 19 more
      

              lpetrovi@redhat.com Lukáš Petrovický (Inactive)
              gdesmet@redhat.com Geoffrey De Smet (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: