-
Enhancement
-
Resolution: Done
-
Critical
-
None
-
6.5.0.CR1
-
None
-
NEW
-
NEW
This works to get the default kieSession:
String ksessionName = null; // if ksessionName is null, then the default kieSession is used KieSessionModel kieSessionModel = kieContainer.getKieSessionModel(ksessionName);
But this doesn't work to get the default ksession:
String ksessionName = null; // Fails if ksessionName is null. Should return the default ksession instead. return kieContainer.newKieSession(ksessionName);
The above fails if ksessioName is null with this stacktrace:
java.lang.NullPointerException at java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1011) at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1006) at org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:692) at org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:652) at org.optaplanner.core.impl.score.director.drools.DroolsScoreDirectorFactory.newKieSession(DroolsScoreDirectorFactory.java:129)
If no default ksession exists with argument null, a nice error message should be thrown.
- causes
-
PLANNER-650 NullPointerException when using an empty kmodule.xml or a default ksessionName
- Resolved