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

Exhaustive search by type BRUTE_FORCE causes NullPointerException in FULL_ASSERT environment

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 6.3.0.Beta1
    • 6.2.0.Final
    • None
    • None

      We were experimenting with Exhaustive search algorithm in our project to work with small data sets, and found the following problem when solution environment is FULL_ASSERT and exhaustive search type is BRUTE_FORCE:

      2015-05-21 11:52:47,238 [AWT-EventQueue-0] INFO  Opened: data/nqueens/unsolved/4queens.xml
      2015-05-21 11:52:48,827 [SwingWorker-pool-3-thread-1] INFO  Solving started: time spent (10), best score (uninitialized/0), environment mode (FULL_ASSERT), random (JDK with seed 0).
      Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Solving failed.
      	at org.optaplanner.examples.common.swingui.SolverAndPersistenceFrame$SolveWorker.done(SolverAndPersistenceFrame.java:297)
      	at javax.swing.SwingWorker$5.run(SwingWorker.java:737)
      	at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(SwingWorker.java:832)
      	at sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:112)
      	at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(SwingWorker.java:842)
      	at javax.swing.Timer.fireActionPerformed(Timer.java:312)
      	at javax.swing.Timer$DoPostEvent.run(Timer.java:244)
      	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
      	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:745)
      	at java.awt.EventQueue.access$300(EventQueue.java:103)
      	at java.awt.EventQueue$3.run(EventQueue.java:706)
      	at java.awt.EventQueue$3.run(EventQueue.java:704)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
      	at java.awt.EventQueue.dispatchEvent(EventQueue.java:715)
      	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
      	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
      	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
      	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
      	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
      	at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
      Caused by: java.lang.NullPointerException
      	at org.optaplanner.core.impl.score.director.AbstractScoreDirector.assertWorkingScoreFromScratch(AbstractScoreDirector.java:332)
      	at org.optaplanner.core.impl.solver.scope.DefaultSolverScope.assertWorkingScoreFromScratch(DefaultSolverScope.java:118)
      	at org.optaplanner.core.impl.phase.scope.AbstractPhaseScope.assertWorkingScoreFromScratch(AbstractPhaseScope.java:131)
      	at org.optaplanner.core.impl.exhaustivesearch.DefaultExhaustiveSearchPhase.restoreWorkingSolution(DefaultExhaustiveSearchPhase.java:214)
      	at org.optaplanner.core.impl.exhaustivesearch.DefaultExhaustiveSearchPhase.solve(DefaultExhaustiveSearchPhase.java:103)
      	at org.optaplanner.core.impl.solver.DefaultSolver.runPhases(DefaultSolver.java:213)
      	at org.optaplanner.core.impl.solver.DefaultSolver.solve(DefaultSolver.java:176)
      	at org.optaplanner.examples.common.business.SolutionBusiness.solve(SolutionBusiness.java:302)
      	at org.optaplanner.examples.common.swingui.SolverAndPersistenceFrame$SolveWorker.doInBackground(SolverAndPersistenceFrame.java:286)
      	at org.optaplanner.examples.common.swingui.SolverAndPersistenceFrame$SolveWorker.doInBackground(SolverAndPersistenceFrame.java:276)
      	at javax.swing.SwingWorker$1.call(SwingWorker.java:296)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      	at javax.swing.SwingWorker.run(SwingWorker.java:335)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:745)
      

      It was reproducible with optaplanner version 6.2.0.FINAL on provided examples.

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

                Created:
                Updated:
                Resolved: