2 Replies Latest reply on Jul 10, 2016 11:29 AM by nikosmak

    Jboss rule 6.4.0 Cannot find a default StatelessKieSession

    nikosmak Newbie

      Hello,

       

      I have downloaded the drools 6.4.0 distribution and i am trying to execute a drools application via a main method in eclipse.

      According to the documentation i have the following code that produces the exception.

       

      KieServices kieServices = KieServices.Factory.get();
      KieContainer kContainer = kieServices.getKieClasspathContainer();
      StatelessKieSession kSession = kContainer.newStatelessKieSession();

       

      The exception that is thrown is

       

      Exception in thread "main" java.lang.RuntimeException: Cannot find a default StatelessKieSession

        at org.drools.compiler.kie.builder.impl.KieContainerImpl.findKieSessionModel(KieContainerImpl.java:555)

        at org.drools.compiler.kie.builder.impl.KieContainerImpl.newStatelessKieSession(KieContainerImpl.java:565)

        at org.drools.compiler.kie.builder.impl.KieContainerImpl.newStatelessKieSession(KieContainerImpl.java:561)

        at com.company.licence.DroolsBootstraper.main(DroolsBootstraper.java:42)

       

      Can somebody assist?

       

      Thank you.