简体   繁体   中英

Drools with SOAP web service in eclipse

In eclipse, I am developing a soap based web service for which I decided to make use of Drools for writing business logic. This is what I did to integrate drools to eclipse: - Installed the drools plugin in eclipse using "Install new software" option. - Copied all the drools jar files into "Referenced Libraries" folder. - Continued working with my previously created dynamic web project with the newly added drools jar files.

At one stage of my thread (launched using threadpool executor's submit method) where I am building the knowledge base, I have kieServices initialization as shown below:

kieServices ks = kieServices.Factory.get();

But the application crashes at this point. When I tried to debug in eclipse, the application reaches this initialization point and when I step into it as part of debugging, it takes me to one of the catch blocks of java.util.concurrent.FutureTask.class.

So, there is some exception being thrown by this factory which I could not catch even using base Exception class. It is neither being caught nor I can see any stack trace in any of the tomcat logs.

    try {
        // load up the knowledge base
        KieServices ks = KieServices.Factory.get();
        KieContainer kContainer = ks.getKieClasspathContainer();
        KieSession kSession = kContainer.newKieSession("ksession-rules");
        ...
        ...
         }
    catch(Exception e) {
              e.printStackTrace(); }

Any help would be highly appreciated.

Note: this kieServices factory call works just fine if I use the same drools jar in a separate Drools project (not dynamic web project) in eclipse.

I was able to figure out the issue myself. There was an exception being thrown of type Throwable for which the catch block was missing from the code. The exception thrown was NoClassDefFoundError. Added the catch block and got rid of exception by copying missing jars in runtime environment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM