[
https://issues.jboss.org/browse/DROOLS-3337?page=com.atlassian.jira.plugi...
]
Mario Fusco resolved DROOLS-3337.
---------------------------------
Resolution: Explained
You're creating the KieSession in the wrong way.
If you do
{code}
KieBase kbase = kieContainer.getKieBase("rules");
KieSession ksession = kbase.newKieSession(null, env);
{code}
the session is not under the control of the kiecontainer and then cannot take the conf in
kmodule file. Conversely if you create the kiesession directly from the container like
in:
{code}
KieSession ksession = kieContainer.newKieSession("ksession-rules", env);
{code}
then the session can be initialized with what defined in the kmodule file.
Note that your reproducer was wrong anyway because you missed to specify
clockType="pseudo" in the kmodule.xml
ClassCastException while using SessionPseudoClock
-------------------------------------------------
Key: DROOLS-3337
URL:
https://issues.jboss.org/browse/DROOLS-3337
Project: Drools
Issue Type: Bug
Components: core engine
Affects Versions: 6.1.0.Final
Reporter: Bishnu Shankar Pandey
Assignee: Mario Fusco
Priority: Major
Attachments: RuleEngineTest (2).zip
I am using 6.1.0.Final version of Drool. I am getting
{code:java}
java.lang.ClassCastException: org.drools.core.time.impl.JDKTimerService cannot be cast to
org.drools.core.time.SessionPseudoClock
{code}
exception when I am trying to get session clock from the KieSession.
I am using Persistence and getting the KieSession using this
{code:java}
val kieSession = kieServices.getStoreServices.newKieSession(kiebase,null,environment);
{code}
My kmodule.xml is:
{code:java}
<kmodule
xmlns="http://jboss.org/kie/6.0.0/kmodule">
<kbase name="rules" packages="rules"
eventProcessingMode="stream">
<ksession name="ksession-rules" clockType="pseudo"/>
</kbase>
</kmodule>
{code}
--
This message was sent by Atlassian Jira
(v7.12.1#712002)