Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-3634

A null pointer in DRL non-null safe navigation should clearly mention the DRL line for which it occurs

    Details

    • Type: Enhancement
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Out of Date
    • Affects Version/s: 5.4.0.Final
    • Fix Version/s: None
    • Labels:
      None

      Description

      In a very big DRL file, there are many references like this:

      when
         ...
         Course($c : timeslot.calendarDate)
         ...
      

      Now, one of them did something wrong, which one?

      Exception in thread "main" java.lang.RuntimeException: cannot invoke getter: getTimeSlot [declr.class: org.Course; act.class: org.Course] (see trace)
      at org.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:74)
      at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:108)
      at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
      at org.mvel2.compiler.CompiledExpression.getDirectValue(CompiledExpression.java:123)
      at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:119)
      at org.mvel2.MVEL.executeExpression(MVEL.java:954)
      at org.drools.base.extractors.MVELClassFieldReader.getValue(MVELClassFieldReader.java:100)
      at org.drools.base.extractors.BaseObjectClassFieldReader.getHashCode(BaseObjectClassFieldReader.java:204)
      at org.drools.rule.Declaration.getHashCode(Declaration.java:287)
      at org.drools.core.util.AbstractHashTable$DoubleCompositeIndex.hashCodeOf(AbstractHashTable.java:627)
      at org.drools.core.util.index.LeftTupleIndexHashTable.removeAdd(LeftTupleIndexHashTable.java:332)
      at org.drools.reteoo.JoinNode.modifyLeftTuple(JoinNode.java:310)
      at org.drools.reteoo.LeftTupleSource.doModifyLeftTuple(LeftTupleSource.java:304)
      at org.drools.reteoo.LeftTupleSource.modifyLeftTuple(LeftTupleSource.java:278)
      at org.drools.reteoo.JoinNode.modifyLeftTuple(JoinNode.java:437)
      at org.drools.reteoo.CompositeLeftTupleSinkAdapter.doPropagateModifyObject(CompositeLeftTupleSinkAdapter.java:260)
      at org.drools.reteoo.CompositeLeftTupleSinkAdapter.propagateModifyObject(CompositeLeftTupleSinkAdapter.java:275)
      at org.drools.reteoo.LeftInputAdapterNode.modifyObject(LeftInputAdapterNode.java:170)
      at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateModifyObject(CompositeObjectSinkAdapter.java:507)
      at org.drools.reteoo.CompositeObjectSinkAdapter.propagateModifyObject(CompositeObjectSinkAdapter.java:432)
      at org.drools.reteoo.ObjectTypeNode.modifyObject(ObjectTypeNode.java:314)
      at org.drools.reteoo.EntryPointNode.modifyObject(EntryPointNode.java:265)
      at org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:483)
      at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:976)
      at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:949)
      at org.drools.planner.core.score.director.drools.DroolsScoreDirector.afterVariableChanged(DroolsScoreDirector.java:127)
      at org.UninitializerHack.changeWorkingSolution(UninitializerHack.java:16)
      at org.drools.planner.core.phase.custom.DefaultCustomSolverPhase.solve(DefaultCustomSolverPhase.java:50)
      at org.drools.planner.core.solver.DefaultSolver.runSolverPhases(DefaultSolver.java:190)
      at org.drools.planner.core.solver.DefaultSolver.solve(DefaultSolver.java:155)
      at org.drools.planner.benchmark.core.ProblemBenchmark.warmUp(ProblemBenchmark.java:161)
      at org.drools.planner.benchmark.core.DefaultPlannerBenchmark.warmUp(DefaultPlannerBenchmark.java:225)
      at org.drools.planner.benchmark.core.DefaultPlannerBenchmark.benchmark(DefaultPlannerBenchmark.java:172)
      at org.BenchmarkerMain.main(BenchmarkerMain.java:45)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
      Caused by: java.lang.RuntimeException: unable to invoke method: org.TimeSlot.getCalendarDate: target of method is null
      at org.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:66)
      at org.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:40)
      ... 38 more
      Caused by: java.lang.NullPointerException
      at sun.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.mvel2.optimizers.impl.refl.nodes.GetterAccessor.getValue(GetterAccessor.java:43)
      ... 39 more
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mfusco Mario Fusco
                Reporter:
                ge0ffrey Geoffrey De Smet
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: