[rules-users] drools-solver NPE in DefaultSimpleScore

Andrew Waterman andrew.waterman at gmail.com
Thu Nov 26 12:23:18 EST 2009


Hi,

I migrated some solver code that I had working on 5.0M4 to the 5.1.0  
implementation.  I'm now seeing the following while running the solver:

java.lang.NullPointerException
	at org.drools.solver.core.score.DefaultSimpleScore.compareTo 
(DefaultSimpleScore.java:73)
	at org.drools.solver.core.score.DefaultSimpleScore.compareTo 
(DefaultSimpleScore.java:13)
	at  
org.drools.solver.core.localsearch.bestsolution.BestSolutionRecaller.stepTaken 
(BestSolutionRecaller.java:56)
	at  
org.drools.solver.core.localsearch.DefaultLocalSearchSolver.stepTaken 
(DefaultLocalSearchSolver.java:171)
	at  
org.drools.solver.core.localsearch.DefaultLocalSearchSolver.solveImplementation 
(DefaultLocalSearchSolver.java:121)
	at org.drools.solver.core.AbstractSolver.solve(AbstractSolver.java:41)

I ran my test with a debugger attached, and this call is returning a  
Null:

Score bestScore = localSearchSolverScope.getBestScore();
<org.drools.solver.core.localsearch.bestsolution.BestSolutionRecaller:  
55>

The BestSolution is not null although the best score is.

Should I file an issue on this in JIRA?  Or perhaps this reflects some  
change to the old code that I didn't migrate properly?

best wishes,

Andrew






More information about the rules-users mailing list