Cannot find query in kjar

8 views
Skip to first unread message

Dave Carlson

unread,
Nov 2, 2017, 12:29:22 PM11/2/17
to Drools Usage
Hello, 

I have been working on a drools project and we recently started building our spreadsheets into kjars using kie-maven-plugin. Right now, to test the kjar build, I have 1 spreadsheet and 1 query. The issue I am having is the query is not found. I am not sure if the spreadsheet rules are found, but I am getting a session. 

Sorry for the long post, but I really need help. Full info below...

My kmodule.xml:
<kbase name="com.foo.ratings.decisionTables.flex">
      <ksession name="flex"/>
</kbase>

My query:
package com.foo.ratings.decisionTables.flex;

import com.foo.ratings.tangerinegin.facts.*;

query "getFlexCode"
    $flexGroupCd: FlexGroupCdFact()
end

The error:
2017-11-02 11:01:35.727 ERROR 34585 --- [nio-8080-exec-6] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.RuntimeException: Query 'getFlexCode' does not exist] with root cause

java.lang.RuntimeException: Query 'getFlexCode' does not exist
at org.drools.core.impl.StatefulKnowledgeSessionImpl$ExecuteQuery.execute(StatefulKnowledgeSessionImpl.java:907) ~[drools-core-7.1.0.Final.jar!/:7.1.0.Final]
at org.drools.core.phreak.SynchronizedPropagationList$1.execute(SynchronizedPropagationList.java:53) ~[drools-core-7.1.0.Final.jar!/:7.1.0.Final]

We have looked inside the kjar, and we see the kmodule.xml, as well as the kbase.cache. Here is the expanded jar:
drwxr-xr-x  7 localadmin  staff  238 Nov  2 11:17 META-INF
-rw-r--r--  1 localadmin  staff    0 Nov  2 10:54 application.properties
drwxr-xr-x  3 localadmin  staff  102 Nov  2 10:54 com
com expands to com/foo/ratings/decisionTables/flex and contains both my spreadsheet and my query drl file. 

Here is META-INF expanded:
-rw-r--r--  1 localadmin  staff     100 Nov  2 10:56 MANIFEST.MF
drwxr-xr-x  3 localadmin  staff     102 Nov  2 10:56 com
-rw-r--r--  1 localadmin  staff  752813 Nov  2 10:56 kmodule.info
-rw-r--r--  1 localadmin  staff     209 Nov  2 10:54 kmodule.xml
drwxr-xr-x  4 localadmin  staff     136 Nov  2 10:54 maven

META-INF/com expands to com/foo/ratings/decisionTables/flex and contains my kbase.cache.

My pom:
<groupId>com.foo.ratings.tangerineGin</groupId>
<artifactId>MyFlex</artifactId>
<version>1.0.2</version>

<packaging>kjar</packaging>

<build>
  <plugins>
    <plugin>
      <groupId>org.kie</groupId>
      <artifactId>kie-maven-plugin</artifactId>
      <version>7.1.0.Final</version>
      <extensions>true</extensions>
    </plugin>
  </plugins>
</build>

<rulesByPackage>
    <entry>
      <string>com.foo.ratings.decisionTables.flex</string>
      <set>
        <string>getFlexCode</string>
      </set>
    </entry>
    <entry>
      <string>com.foo.decisionTable.calculateFlexGroup_CO</string>
      <set>
        <string>calculate_flex_959</string>

I am obviously missing something simple, but I am really spinning my wheels at this point. Any help greatly appreciated.

Thanks
Reply all
Reply to author
Forward
0 new messages