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(ObjectFactory.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(SingleObjectSinkAdapter.java:22)

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

            at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.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:909)

            at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:881)

            at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:682)

            at net.intellidata.sleuth.description.DefinitionRuleTest.testApplicationRules(DefinitionRuleTest.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(JUnit3TestReference.java:130)

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

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

            at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.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@intellidata.net