[rules-users] Strange exception

Brian Trezise Brian.Trezise at intellidata.net
Tue Mar 4 12:09:49 EST 2008


I'm getting a strange exception upon inserting an object into working
memory.  Relevant information follows:

I'm creating a "smartdescription" which contains a string and some
information about that string that is later added by the rules.  With the
exception of one specific string, this seems to be working perfectly.  I'm
using regexes to match the strings.

 

This is the regex where I'm having the problem:

   public static final String REGEX_APPLICATION_CURRENT_SENSE = ".*(" +
"CURRENT[ .]?SENSE?" + ").*";

 

and the smartdescription string I'm testing is "aaaaaaaaaaaaaaaaaaa current
sense aaaaaaaaaaaaa".  

 

I have determined that any other string that matches any of the identically
formulated rules works with no problems.  If I put in something that doesn't
match this regex, there is no exception.  The RHS of the rule in question is
not reached in this case.

 

This is the exception:

java.lang.ClassCastException: java.util.HashMap

            at
org.drools.base.evaluators.ObjectFactory$ObjectContainsEvaluator.evaluate(Ob
jectFactory.java:433)

            at
org.drools.rule.LiteralRestriction.isAllowed(LiteralRestriction.java:61)

            at
org.drools.rule.LiteralConstraint.isAllowed(LiteralConstraint.java:82)

            at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:132)

            at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObject
SinkAdapter.java:22)

            at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:140)

            at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(Composite
ObjectSinkAdapter.java:318)

            at
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:153)

            at org.drools.reteoo.Rete.assertObject(Rete.java:175)

            at
org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)

            at
org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)

            at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:90
9)

            at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:88
1)

            at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:68
2)

            at
net.intellidata.sleuth.description.DefinitionRuleTest.testApplicationRules(D
efinitionRuleTest.java:129)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)

            at java.lang.reflect.Method.invoke(Unknown Source)

            at junit.framework.TestCase.runTest(TestCase.java:154)

            at junit.framework.TestCase.runBare(TestCase.java:127)

            at junit.framework.TestResult$1.protect(TestResult.java:106)

            at junit.framework.TestResult.runProtected(TestResult.java:124)

            at junit.framework.TestResult.run(TestResult.java:109)

            at junit.framework.TestCase.run(TestCase.java:118)

            at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3T
estReference.java:130)

            at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:3
8)

            at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java:460)

            at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRu
nner.java:673)

            at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.
java:386)

            at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner
.java:196)

 

Any idea what could be causing this???

 

DefinitionRuleTest.java:129 is

             workingMemory.insert(sd);

 

Thanks,

___________________________________________________
Brian Trezise
Staff Software Engineer
IntelliData, Inc
3173 s. uravan way
aurora, colorado 80013
T: 720.524.4864
brian.trezise at intellidata.net

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20080304/bae5a375/attachment.html 


More information about the rules-users mailing list