Re: [rules-users] Optaplanner: Unexpected global [scoreHolder] - Kie API trouble
It seems to also throw this error any time the path includes the character: \ Even properly escaped in the string as \\ -- View this message in context: http://drools.46999.n3.nabble.com/Optaplanner-Unexpected-global-scoreHolder-tp4023837p4026886.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Optaplanner: Unexpected global [scoreHolder] - Kie API trouble
Which path in what file? On 22-11-13 15:27, jonathan.labin wrote: It seems to also throw this error any time the path includes the character: \ Even properly escaped in the string as \\ -- View this message in context: http://drools.46999.n3.nabble.com/Optaplanner-Unexpected-global-scoreHolder-tp4023837p4026886.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Optaplanner: Unexpected global [scoreHolder] - Kie API trouble
I am calling KieFileSystem.write(String path ,String content) but the same issue may be experienced with any of the versions of write that take a path parameter but I haven't tried them. I found that if the path parameter includes a character \ there is no error produced when calling KieFileSystem.write(...). When a KieBuilder.buildAll() is called a warning is logged: [o.d.compiler.kie.builder.impl.AbstractKieModule ] No files found for KieBase defaultKieBase Then when solving begins the exception is thrown: java.lang.RuntimeException: Unexpected global [scoreHolder] (the same stack trace provided at the beginning of this thread). For my code I've done a String regex just before the write call to swap any \ into / replaceAll(,/) -- View this message in context: http://drools.46999.n3.nabble.com/Optaplanner-Unexpected-global-scoreHolder-tp4023837p4026888.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Optaplanner: Unexpected global [scoreHolder] - Kie API trouble
Looks like a bug in drools, not really relate to optaplanner as it happens before you set this KieBase on OptaPlanner's SolverFactory, I presume? If (and only if) it reproduces with drools 6.0.0.Final (optaplanner 6.0.0.Final uses that version), create a new jira: https://issues.jboss.org/browse/DROOLS We're in squashing bugs mode, so it's a perfect time to create these jira's :) On 22-11-13 16:19, jonathan.labin wrote: I am calling KieFileSystem.write(String path ,String content) but the same issue may be experienced with any of the versions of write that take a path parameter but I haven't tried them. I found that if the path parameter includes a character \ there is no error produced when calling KieFileSystem.write(...). When a KieBuilder.buildAll() is called a warning is logged: [o.d.compiler.kie.builder.impl.AbstractKieModule ] No files found for KieBase defaultKieBase Then when solving begins the exception is thrown: java.lang.RuntimeException: Unexpected global [scoreHolder] (the same stack trace provided at the beginning of this thread). For my code I've done a String regex just before the write call to swap any \ into / replaceAll(,/) -- View this message in context: http://drools.46999.n3.nabble.com/Optaplanner-Unexpected-global-scoreHolder-tp4023837p4026888.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Optaplanner: Unexpected global [scoreHolder] - Kie API trouble
The exception is not finally thrown until the call to solver.solve(); -- View this message in context: http://drools.46999.n3.nabble.com/Optaplanner-Unexpected-global-scoreHolder-tp4023837p4026891.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Optaplanner: Unexpected global [scoreHolder] - Kie API trouble
then file a jira in optaplanner, it might be optaplanner's fault in ScoreDirectorFactoryConfig.java. On 22-11-13 17:14, jonathan.labin wrote: The exception is not finally thrown until the call to solver.solve(); -- View this message in context: http://drools.46999.n3.nabble.com/Optaplanner-Unexpected-global-scoreHolder-tp4023837p4026891.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Optaplanner: Unexpected global [scoreHolder] - Kie API trouble
I presume you're building your own KieBase and setting it with setKieBase() ? If so, that KieBase is empty or corrupted or something, but it doesn't fail-fast either apparently. Look at this code for inspiration (that's where I ran into it too): https://github.com/droolsjbpm/optaplanner/blob/master/optaplanner-core/src/main/java/org/optaplanner/core/config/score/director/ScoreDirectorFactoryConfig.java#L299 Please let us know what exactly the problem was here on the mailing list. I want to create a jira for DROOLS to fail-fast during KieBase construction when a misconfiguration happens. On 15-05-13 16:18, jonathan.labin wrote: I am using Optaplanner 6.0.0-Beta2 and I am in some cases receiving the following error during initial solution construction: 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) I noticed this error in gist: https://gist.github.com/ge0ffrey/5236604 If this is the same error, what are the current constraints that I need adhere to in order to avoid this error? Jon -- View this message in context: http://drools.46999.n3.nabble.com/Optaplanner-Unexpected-global-scoreHolder-tp4023837.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
Re: [rules-users] Optaplanner: Unexpected global [scoreHolder] - Kie API trouble
My problem turned out to be due to a lack of understanding of what KieFileSystem does. I'm still not sure i fully understand but I noticed that you added a fixed prefix to your path provided to kieFileSystem.write(...) I didn't have this prefix and used the provided path directly. When this path was absolute or did not fall under what KieFileSystem obviously prefers, i would get the Unexpected global [scoreHolder] error once planning started. From what I can tell, this error occurred anytime the provided path began with something other than src/main/resources/ Jon -- View this message in context: http://drools.46999.n3.nabble.com/Optaplanner-Unexpected-global-scoreHolder-tp4023837p4023868.html Sent from the Drools: User forum mailing list archive at Nabble.com. ___ rules-users mailing list rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users