drools on wildfly is not working
senlog80 May 23, 2017 9:17 AMHi,
I am new to drools.
I am using drools 6.5.0 and wildfly 10.
My drools rules are executed in eclipse perfectly.
I am developing a REST application with drools rules and executing through REST url.
My REST application is deployed successfully on wildfly.
But, If I call the url, it throws the below exception in wildfly console.
Is it mandatory to deploy KIE server for the rule execution? Because in tomcat the same application is working fine without KIE server.
I have the following code :
droolsTest.java
KieServices ks = KieServices.Factory.get(); // working fine
KieContainer kContainer = ks.getKieClasspathContainer(); // Error thrown in this statement
KieSession kSession = kContainer.newKieSession("ksession-rules");
Message message = new Message();
message.setMessage("Hello World Testing");
message.setStatus(Message.HELLO);
kSession.insert(message);
kSession.fireAllRules();
System.out.println("Drools Rules execution is Completed");
16:32:45,757 INFO [stdout] (default task-3) Error caught :java.lang.NoClassDefF
oundError: Could not initialize class org.drools.compiler.kie.builder.impl.KieCo
ntainerImpl
16:32:45,758 ERROR [stderr] (default task-3) java.lang.NoClassDefFoundError: Cou
ld not initialize class org.drools.compiler.kie.builder.impl.KieContainerImpl
16:32:45,760 ERROR [stderr] (default task-3) at org.drools.compiler.kie.build
er.impl.KieServicesImpl.newKieClasspathContainer(KieServicesImpl.java:135)
16:32:45,761 ERROR [stderr] (default task-3) at org.drools.compiler.kie.build
er.impl.KieServicesImpl.getKieClasspathContainer(KieServicesImpl.java:101)
16:32:45,762 ERROR [stderr] (default task-3) at org.drools.compiler.kie.build
er.impl.KieServicesImpl.getKieClasspathContainer(KieServicesImpl.java:79)
16:32:45,762 ERROR [stderr] (default task-3) at com.sample.DroolsTest.drools(
DroolsTest.java:40)
Could any one provide your help.
Thanks
Senthil