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

Fail-fast if global scoreHolder does not exist. (Was: Unexpected global [scoreHolder] when backslash in KieFileSystem)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 6.2.0.Beta1
    • 6.0.0.Final
    • optaplanner-core
    • None

    Description

      solver.solve() throws an exception when configured with a KieBase that was built using calls to KieFileSystem.write(String path, String content) where path contains the \ character.

      Exception in thread "main" java.lang.RuntimeException: Unexpected global [scoreHolder] 
              at org.drools.core.common.AbstractWorkingMemory.setGlobal(AbstractWorkingMemory.java:515) 
              at org.drools.core.impl.StatefulKnowledgeSessionImpl.setGlobal(StatefulKnowledgeSessionImpl.java:360) 
              at org.optaplanner.core.impl.score.director.drools.DroolsScoreDirector.resetKieSession(DroolsScoreDirector.java:83) 
              at org.optaplanner.core.impl.score.director.drools.DroolsScoreDirector.setWorkingSolution(DroolsScoreDirector.java:74) 
              at org.optaplanner.core.impl.solver.scope.DefaultSolverScope.setWorkingSolutionFromBestSolution(DefaultSolverScope.java:176) 
              at org.optaplanner.core.impl.solver.DefaultSolver.solvingStarted(DefaultSolver.java:176) 
              at org.optaplanner.core.impl.solver.DefaultSolver.solve(DefaultSolver.java:154) 
      

      The same issue may be experienced with any of the versions of write that take a "path" parameter but I haven't tried them myself.

      No error or exception is produced by the call to KieFileSystem.write(...) itself.
      When a KieBuilder.buildAll() is called a warning is logged:
      [o.d.compiler.kie.builder.impl.AbstractKieModule ] No files found for KieBase defaultKieBase

      Other than this log entry there is no indication of a problem until the exception is thrown when calling solver.solve()

      Attachments

        Activity

          People

            gdesmet@redhat.com Geoffrey De Smet (Inactive)
            jonathan.labin Jonathan Labin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: