<div><br></div> Vincent,<div><br></div><div> It seems it is a merging problem on declarations, but unfortunately, the exceptions you are seeing are the symptoms, not the cause, so I can't infer much from them.</div>
<div><br></div><div> Some suggestions to try to isolate the problem: are the fact types (classes) in the same package or different packages? Are the declaration(s)/rules in the same file or different files? Are you using a single kbuilder to build the whole thing on your application or using different kbuilders? Is the order in which you are loading the files into the kbuilder and the order you add packages in your kbase the same on your application and your test?</div>
<div><br></div><div> These are some of the conditions that trigger declaration merges. I know it is not much, but try checking these things... maybe you get lucky and manage to reproduce the problem so that we can debug it and fix it.</div>
<div><br></div><div> Also, which version of Drools are you using? Did you tried with latest snapshot from the 5.3.x branch or with master branch (5.4.x)?</div><div><br></div><div> Any additional information you can give us might help us figure out the problem.</div>
<div><br></div><div> Thanks,</div><div> Edson<br><br><div class="gmail_quote">On Mon, Nov 28, 2011 at 11:01 AM, Vincent LEGENDRE <span dir="ltr"><<a href="mailto:vincent.legendre@eurodecision.com">vincent.legendre@eurodecision.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Well, after trying and trying to reproduce with a simpler case, @role is always correctly inherited.<br>
But in my application, it seems not, or may be it is another problem.<br>
<br>
I have 3 classes : ChantierEvent (the main mother class) and its 2 subClasses : InitEvent and DisposeEvent<br>
When I declare @role(event) for all 3 classes, everything works wells<br>
When I only declare for the motherclass, this exception is raised (at insertion of a InitEvent) :<br>
java.lang.ClassCastException: org.drools.common.DefaultFactHandle cannot be cast to org.drools.common.EventFactHandle<br>
at org.drools.base.evaluators.AfterEvaluatorDefinition$AfterEvaluator.evaluateCachedRight(AfterEvaluatorDefinition.java:316)<br>
at org.drools.rule.VariableRestriction.isAllowedCachedRight(VariableRestriction.java:122)<br>
at org.drools.rule.VariableConstraint.isAllowedCachedRight(VariableConstraint.java:121)<br>
at org.drools.common.TripleBetaConstraints.isAllowedCachedRight(TripleBetaConstraints.java:208)<br>
at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:158)<br>
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:458)<br>
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:386)<br>
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:215)<br>
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:244)<br>
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:330)<br>
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:291)<br>
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:886)<br>
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:845)<br>
at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:255)<br>
--> call of insert(new InitEvent(...));<br>
at com.sncf.morse.server.MVFusionThreadSession.addEvent(MVFusionThreadSession.java:158)<br>
<br>
<br>
I first think about a problem on "after" operator, so I commented out the rule that uses it, and this error is raised then (I also use sliding windows) :<br>
java.lang.ClassCastException: org.drools.common.DefaultFactHandle cannot be cast to org.drools.common.EventFactHandle<br>
at org.drools.rule.SlidingTimeWindow.updateNextExpiration(SlidingTimeWindow.java:211)<br>
at org.drools.rule.SlidingTimeWindow.assertRightTuple(SlidingTimeWindow.java:128)<br>
at org.drools.rule.BehaviorManager.assertRightTuple(BehaviorManager.java:84)<br>
at org.drools.reteoo.NotNode.assertObject(NotNode.java:114)<br>
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:458)<br>
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:386)<br>
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:215)<br>
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:244)<br>
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:330)<br>
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:291)<br>
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:886)<br>
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:845)<br>
at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:255)<br>
--> call of insert(new InitEvent(...));<br>
at com.sncf.morse.server.MVFusionThreadSession.addEvent(MVFusionThreadSession.java:158)<br>
<br>
<br>
Do you have any ideas on why this could happend ?<br>
In what case the role could not be inherited (I tried to make my minimal sample class look like the real one, but I can't reproduce ..).<br>
<br>
thanks<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>
</div>