2 Replies Latest reply on Apr 27, 2013 5:44 PM by anikulin

    SwitchYard 0.8.0.Final with Drools 5.5.0.Final

    anikulin

      Hi

       

      I had an application on Switchyard 0.6.0.Final, that used Drools 5.5.0.Final with our own rules implementation and it worked. Now I updated the project to SwitchYard 0.8.0.Final and i still want to use Drools 5.5.0.Final, but i have such error if i use my old implementation. It looks like these:

       

       

       

      
      ResourceChangeScannerConfiguration sconf = ResourceFactory
      
      
      
      
      
      
      .getResourceChangeScannerService()
      
      
      
      
      .newResourceChangeScannerConfiguration();
      
      
      sconf.setProperty("drools.resource.scanner.interval", scannerInterval);
      
      
      
      
      ResourceFactory.getResourceChangeScannerService().configure(sconf);
      
      
      
      
      
      
      KnowledgeAgentConfiguration aconf = KnowledgeAgentFactory
      
      
      
      
      .newKnowledgeAgentConfiguration();
      
      
      aconf.setProperty("drools.agent.scanDirectories", "true");
      
      
      aconf.setProperty("drools.agent.scanResources", "true");
      
      
      aconf.setProperty("drools.agent.newInstance", "true");
      
      
      
      
      kagent = KnowledgeAgentFactory.newKnowledgeAgent("changeSetAgent",
      
      
      
      
      
      
      aconf);
      
      
      
      
      kagent.applyChangeSet(ResourceFactory
      
      
      
      
      .newClassPathResource("ChangeSet.xml"));
      
      
      
      
      
      StatefulKnowledgeSession session = kagent.getKnowledgeBase().newStatefulKnowledgeSession();
      
      

       

      And when this of code is invoked on server, i had such error:

       

       

       

      Caused by: java.lang.NoClassDefFoundError: org/kie/event/kiebase/KieBaseEventListener

          at org.jbpm.process.instance.ProcessRuntimeFactoryServiceImpl.newProcessRuntime(ProcessRuntimeFactoryServiceImpl.java:10) [jbpm-flow-6.0.0.Alpha6.jar:6.0.0.Alpha6]

          at org.jbpm.process.instance.ProcessRuntimeFactoryServiceImpl.newProcessRuntime(ProcessRuntimeFactoryServiceImpl.java:6) [jbpm-flow-6.0.0.Alpha6.jar:6.0.0.Alpha6]

          at org.drools.runtime.process.ProcessRuntimeFactory.newProcessRuntime(ProcessRuntimeFactory.java:12) [drools-core-5.5.0.Final.jar:5.5.0.Final]

          at org.drools.common.AbstractWorkingMemory.createProcessRuntime(AbstractWorkingMemory.java:342) [drools-core-5.5.0.Final.jar:5.5.0.Final]

          at org.drools.common.AbstractWorkingMemory.setKnowledgeRuntime(AbstractWorkingMemory.java:1268) [drools-core-5.5.0.Final.jar:5.5.0.Final]

          at org.drools.impl.StatefulKnowledgeSessionImpl.<init>(StatefulKnowledgeSessionImpl.java:121) [drools-core-5.5.0.Final.jar:5.5.0.Final]

          at org.drools.impl.StatefulKnowledgeSessionImpl.<init>(StatefulKnowledgeSessionImpl.java:113) [drools-core-5.5.0.Final.jar:5.5.0.Final]

          at org.drools.reteoo.ReteooRuleBase.newStatefulSession(ReteooRuleBase.java:407) [drools-core-5.5.0.Final.jar:5.5.0.Final]

          at org.drools.reteoo.ReteooRuleBase.newStatefulSession(ReteooRuleBase.java:387) [drools-core-5.5.0.Final.jar:5.5.0.Final]

          at org.drools.impl.KnowledgeBaseImpl.newStatefulKnowledgeSession(KnowledgeBaseImpl.java:175) [drools-core-5.5.0.Final.jar:5.5.0.Final]

          at org.drools.impl.KnowledgeBaseImpl.newStatefulKnowledgeSession(KnowledgeBaseImpl.java:162) [drools-core-5.5.0.Final.jar:5.5.0.Final]

          at com.magick.magicktrader.trade.DroolsWrapper.newStatefulKnowledgeSession(DroolsWrapper.java:60) [rhythm.jar:]

          at com.magick.magicktrader.trade.TradeRulesBean.sendData(TradeRulesBean.java:163) [rhythm.jar:]

          ... 173 more

      Caused by: java.lang.ClassNotFoundException: org.kie.event.kiebase.KieBaseEventListener from [Module "org.jbpm:main" from local module loader @13c6641 (roots: D:\Programming\switchyard-as7-0.8\modules)]

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

          ... 186 more

       


      I changed jar files in modules/org/drools, deleted rule module from switchyard sybsystem, deleted rule component from as7, but there is still such error.

       

      Can you help me what should i do else to use Drools just as external dependencies with my own implementation?

       

      Thanks, Anton

        • 1. Re: SwitchYard 0.8.0.Final with Drools 5.5.0.Final
          dward

          Anton,

           

          Sounds like this is a resurrection of your previous "Drools integration problem" thread...

           

          It also appears that your ChangeSet is referencing processes (per the "newProcessRuntime" above).  In addition to the KIE/Drools 6.0 jars, there are jBPM 6.0 jars.  They all work together, and are only supported together, for the purposes of our Rules and BPM SwitchYard components.

           

          If you don't care about using SwitchYard's Rules and BPM components, and want to leverage Drools/jBPM 5.5 manually, then you could find and replace the jBPM 6 libraries yourself too.  There is most likely also some jboss classloading trickery you can do via your application's manifest to pick up self-bundled Drools/jBPM 5.5 libraries (via their own modules), but this is not supported in SwitchYard.

           

          I'm sorry that this is probably not the answer you're looking for.

          David

          • 2. Re: SwitchYard 0.8.0.Final with Drools 5.5.0.Final
            anikulin

            Thanks a lot, David!

             

            After updating BPM jars to lower version and deleting SwitchYard BPM component everything seems to work fine.