Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-1071

NPE's stacktrace for an MvelConstraint.evaluate() should give a line number from the source DRL file

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 6.5.0.Final, 7.0.0.Beta2
    • 6.3.0.Final, 6.4.0.Beta2
    • core engine
    • None
    • NEW
    • NEW

      The attached code generates an NPE when running optaplanner/drools, but that stacktrace doesn't tell me which DRL line is responsible for it.

      Stacktrace:

      Caused by: java.lang.NullPointerException: null
      	at ConditionEvaluatoreaa3997683d949e28ce6eaf6feca0ced.evaluate(Unknown Source)  <================ No source DRL line
      	at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:258)
      	at org.drools.core.rule.constraint.MvelConstraint.isAllowedCachedLeft(MvelConstraint.java:226)
      	at org.drools.core.common.DoubleBetaConstraints.isAllowedCachedLeft(DoubleBetaConstraints.java:111)
      	at org.drools.core.phreak.PhreakJoinNode.doLeftInserts(PhreakJoinNode.java:112)
      	at org.drools.core.phreak.PhreakJoinNode.doNode(PhreakJoinNode.java:75)
      	at org.drools.core.phreak.RuleNetworkEvaluator.switchOnDoBetaNode(RuleNetworkEvaluator.java:547)
      	at org.drools.core.phreak.RuleNetworkEvaluator.evalBetaNode(RuleNetworkEvaluator.java:533)
      	at org.drools.core.phreak.RuleNetworkEvaluator.evalNode(RuleNetworkEvaluator.java:369)
      	at org.drools.core.phreak.RuleNetworkEvaluator.innerEval(RuleNetworkEvaluator.java:329)
      	at org.drools.core.phreak.RuleNetworkEvaluator.outerEval(RuleNetworkEvaluator.java:163)
      	at org.drools.core.phreak.RuleNetworkEvaluator.evaluateNetwork(RuleNetworkEvaluator.java:120)
      	at org.drools.core.phreak.RuleExecutor.reEvaluateNetwork(RuleExecutor.java:194)
      	at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:73)
      	at org.drools.core.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:1003)
      	at org.drools.core.common.DefaultAgenda.fireLoop(DefaultAgenda.java:1346)
      	at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1284)
      	at org.drools.core.impl.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:1303)
      	at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1293)
      	at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:1274)
      	at org.optaplanner.core.impl.score.director.drools.DroolsScoreDirector.calculateScore(DroolsScoreDirector.java:84)
      	at org.optaplanner.core.impl.solver.recaller.BestSolutionRecaller.solvingStarted(BestSolutionRecaller.java:70)
      	at org.optaplanner.core.impl.solver.DefaultSolver.solvingStarted(DefaultSolver.java:197)
      	at org.optaplanner.core.impl.solver.DefaultSolver.solve(DefaultSolver.java:175)
      

        1. AbstractPlannerDto.java
          1 kB
        2. EquipmentEquipmentTypesPlannerDto.java
          0.9 kB
        3. LabourDayOffPlannerDto.java
          3 kB
        4. OnHandForProduct.java
          0.4 kB
        5. ProductInventoryTransactionPlannerDto.java
          2 kB
        6. SkillsAndRatesPlannerDto.java
          3 kB
        7. TaskPlannerDto.java
          3 kB
        8. TaskResourceAllocationPlannerDto.java
          4 kB
        9. TaskResourcePlannerDto.java
          0.2 kB
        10. UserPlannerDto.java
          1 kB
        11. ProductPlannerDto.java
          3 kB
        12. activity-scoring.drl
          8 kB

              mfusco@redhat.com Mario Fusco
              idoflax Ido Flax (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: