6 Replies Latest reply on Aug 14, 2009 3:05 AM by Kevin Conner

    ContentBasedRouter Drools problem

    Earnest Dyke Novice

      Greetings all,

      I am trying to use a ContentBasedRouter with a simple set of rules and am getting the below exception. I am running 4.6, jbrules.esb is deployed and appears to start correctly and I can find only one drools-core jar in my deployment.

      Anyone run into this? Help!

      Thanks in advance for any and all help.

      Earnie!

      java.lang.NoClassDefFoundError: org/drools/base/extractors/BaseObjectClassFieldReader
       at java.lang.ClassLoader.defineClass1(Native Method)
       at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
       at org.drools.base.ClassFieldAccessorCache$ByteArrayClassLoader.defineClass(ClassFieldAccessorCache.java:367)
       at org.drools.base.ClassFieldAccessorFactory.getClassFieldReader(ClassFieldAccessorFactory.java:135)
       at org.drools.base.ClassFieldAccessorCache$CacheEntry.getReadAccessor(ClassFieldAccessorCache.java:315)
       at org.drools.base.ClassFieldAccessorCache.getReadAcessor(ClassFieldAccessorCache.java:245)
       at org.drools.base.ClassFieldAccessorStore.wire(ClassFieldAccessorStore.java:379)
       at org.drools.base.ClassFieldAccessorStore.getReader(ClassFieldAccessorStore.java:97)
       at org.drools.base.ClassFieldAccessorStore.getReader(ClassFieldAccessorStore.java:74)
       at org.drools.rule.builder.PatternBuilder.getFieldReadAccessor(PatternBuilder.java:1031)
       at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:326)
       at org.drools.rule.builder.PatternBuilder.buildConstraint(PatternBuilder.java:239)
       at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:196)
       at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:104)
       at org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:69)
       at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:68)
       at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1159)
       at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:649)
       at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:278)
       at org.jboss.internal.soa.esb.services.rules.DroolsRuleBaseHelper.createRuleBaseFromRuleFiles(DroolsRuleBaseHelper.java:106)
       at org.jboss.internal.soa.esb.services.rules.DroolsRuleService.getRuleBaseForFileBasedRules(DroolsRuleService.java:546)
       at org.jboss.internal.soa.esb.services.rules.DroolsRuleService.executeStatelessRules(DroolsRuleService.java:133)
       at org.jboss.internal.soa.esb.services.rules.RuleServiceCallHelper.executeRulesService(RuleServiceCallHelper.java:150)
       at org.jboss.internal.soa.esb.services.rules.RuleServiceCallHelper.executeRulesService(RuleServiceCallHelper.java:65)
       at org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter.route(JBossRulesRouter.java:123)
       at org.jboss.soa.esb.actions.ContentBasedWiretap.executeRules(ContentBasedWiretap.java:171)
       at org.jboss.soa.esb.actions.ContentBasedWiretap.process(ContentBasedWiretap.java:143)
       at org.jboss.soa.esb.actions.ContentBasedRouter.process(ContentBasedRouter.java:58)
       at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:634)
       at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:586)
       at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:420)
       at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:545)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.ClassNotFoundException: org.drools.base.extractors.BaseObjectClassFieldReader
       at java.lang.ClassLoader.findClass(ClassLoader.java:359)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
       at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
       ... 35 more
      


      Rule file:

      package org.ebs.esbdemo.rules
      
      import org.jboss.soa.esb.message.Message;
      import org.jboss.soa.esb.message.format.MessageType;
      import org.ebs.esbdemo.entity.Target;
      
      global java.util.List destinations;
      
      
      rule "Extract Target"
       when
       not Target()
       then
       System.out.println("Extracting Target");
       Target t = (Target)message.getBody().get();
       insert(t);
      end
      
      rule "AF Assigned"
       when
       Target(assignedService != null)
       then
       System.out.println("AF Assigned");
       destinations.add("afAssigned");
      end
      
      rule "AF Not Assigned"
       when
       Target(assignedService == null)
       then
       System.out.println("AF NOT Assigned");
       destinations.add("nonAFAsset");
      end