Uploaded image for project: 'JBRULES'
  1. JBRULES
  2. JBRULES-1009

Can't execute rules twice with a second classloader

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Minor
    • FUTURE
    • 4.0.0.MR3
    • drools-core (expert)
    • None

    Description

      I am trying to sequentially perform two rules executions using two
      different classloaders in the same VM. I create completely new state
      for each execution, yet I still fail on the second execution (the first execution succeeds). I
      believe this has to do with some internal static cached state that
      JBossRules is maintaining. An integration test is attached as an archived Eclipse project (zip).

      Exception thrown:

      Exception in thread "main" java.lang.ClassCastException: test.drools.classloader.FooShadowProxy
      at org.drools.base.test.drools.classloader.Foo$getName.getValue(Unknown Source)
      at org.drools.base.ClassFieldExtractor.getValue(ClassFieldExtractor.java:94)
      at org.drools.base.evaluators.StringFactory$StringEqualEvaluator.evaluate(StringFactory.java:85)
      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:121)
      at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:20)
      at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:159)
      at org.drools.reteoo.Rete.assertObject(Rete.java:175)
      at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)
      at org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:70)
      at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:772)
      at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:584)
      at org.drools.reteoo.ReteooStatelessSession.execute(ReteooStatelessSession.java:63)
      at test.drools.classloader.Driver.testRules(Driver.java:49)
      at test.drools.classloader.Driver.go(Driver.java:35)
      at test.drools.classloader.Driver.main(Driver.java:19)

      Attachments

        Activity

          People

            mproctor@redhat.com Mark Proctor
            atdixon aaron dixon (Inactive)
            Archiver:
            rhn-support-ceverson Clark Everson

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              PagerDuty