[jboss-jira] [JBoss JIRA] (DROOLS-1276) KieContainer.newKieSession((String) null) should return the default ksession to be consistent with getKieSessionModel(null)

Geoffrey De Smet (JIRA) issues at jboss.org
Fri Sep 9 09:49:00 EDT 2016


    [ https://issues.jboss.org/browse/DROOLS-1276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13291227#comment-13291227 ] 

Geoffrey De Smet commented on DROOLS-1276:
------------------------------------------

Raisd priority of this one, because without a fix for this one, the kie optaplanner-execution-server can't handle kjar that use the default ksession (which is a common use case).

> KieContainer.newKieSession((String) null) should return the default ksession to be consistent with getKieSessionModel(null)
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DROOLS-1276
>                 URL: https://issues.jboss.org/browse/DROOLS-1276
>             Project: Drools
>          Issue Type: Enhancement
>          Components: core engine
>    Affects Versions: 6.5.0.CR1
>            Reporter: Geoffrey De Smet
>            Assignee: Mario Fusco
>            Priority: Critical
>
> This works to get the default kieSession:
> {code}
>         String ksessionName = null;
>         // if ksessionName is null, then the default kieSession is used
>         KieSessionModel kieSessionModel = kieContainer.getKieSessionModel(ksessionName);
> {code}
> But this doesn't work to get the default ksession:
> {code}
>         String ksessionName = null;
>         // Fails if ksessionName is null. Should return the default ksession instead.
>         return kieContainer.newKieSession(ksessionName);
> {code}
> The above fails if ksessioName is null with this stacktrace:
> {code}
> 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)
> {code}
> If no default ksession exists with argument null, a nice error message should be thrown.



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list