Integrate KIE Execution Server with KIE workbench - Urgent help needed

4,851 views
Skip to first unread message

Sunil Sahu

unread,
Oct 8, 2015, 11:04:53 AM10/8/15
to Drools Setup, sunil. sahu
Hello Maciej and Michael,

I am working on a use case and I have created rule file and model. I am trying to create container from KIE workbench and deploy my rule. Once I create container, I don't see endpoint value on UI, it says "No Data available".
I have installed workbench 6.3.0.Final on one tomcat instance on port 8080. KIE execution server 6.3.0.Final is running on another tomcat instance (on different server) on port 8080.
I have also followed article (http://mswiderski.blogspot.se/2015/09/unified-kie-execution-server-part-1.html) and change my catalina.bat file to include these setting.

I have added below set of properties on my KIE workbench tomcat instance.
-Dorg.kie.example=false -Dorg.kie.server.controller=http://localhost:8080/workbench/rest/controller -Dorg.kie.server.id=first-kie-server

I have added below set of properties on my KIE execution server tomcat instance.
-Dorg.kie.server.location=http://ServerIP:8230/kie-server/services/rest/server -Dorg.kie.server.id=first-kie-server -Dorg.jbpm.server.ext.disabled=true

Attached is the screen-shot where it shows blank endpoint. I don't see anything in log regarding first-kie-server is successfully connected to controller as it shows on 3rd page of mswiderski's blog.

I also tried running both workbench and execution server on same tomcat instance but I am having issue and endpoint doesn't show anything. 

I will appreciate if you can respond asap and help me fixing this issue. I need to resolve this issue by this weekend in order to meet my deadline.

Thanks
Sunil
ExecutionServerRestCall.png
Workbench_Container.png

Edson Tirelli

unread,
Oct 9, 2015, 10:00:53 AM10/9/15
to drools...@googlegroups.com, sunil. sahu
Sunil,

All the switches you you have (except for the org.kie.example)
should be set on the kie-server instance, not the workbench. So your
kie workbench would be:

-Dorg.kie.example=false

And your kie server would be:

-Dorg.kie.server.controller=http://localhost:8080/workbench/rest/controller
-Dorg.kie.server.id=first-kie-server
-Dorg.kie.server.location=http://ServerIP:8230/kie-server/services/rest/server
-Dorg.jbpm.server.ext.disabled=true

You also have to provide the user and password properties, unless
you are using the default user/password.

Edson
> --
> You received this message because you are subscribed to the Google Groups
> "Drools Setup" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to drools-setup...@googlegroups.com.
> To post to this group, send email to drools...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/drools-setup/d442f161-2d68-4a05-b9e6-875d872263cc%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Edson Tirelli
Principal Software Engineer
Red Hat Business Systems and Intelligence Group

Sunil Sahu

unread,
Oct 9, 2015, 11:10:21 AM10/9/15
to Drools Setup, sunil...@gmail.com
Thanks a ton Edson.  I have made the changes. I have also created kieserver user with given password (as mentioned in http://mswiderski.blogspot.com/) and it's working fine now, I can see that it's connected from tomcat console and endpoint is displaying kie-server URL in workbench.

Thanks again for your help.

Thanks
Sunil

Sunil Sahu

unread,
Oct 9, 2015, 2:50:33 PM10/9/15
to Drools Setup, sunil...@gmail.com
Now I am having different issue and have been struggling since morning. As I mentioned before, I have KIE workbench 6.3.0.Final on one tomcat instance and KIE execution 6.3.0.Final on another tomcat instance on remote server.

I have created container from workbench and its started successfully from workbench. I can see JAR file and everything under M2 repo on server which has workbench and KIE execution server. Attached are the screen-shots from both m2 repo. I have also attached error I see on tomcat console on KIE execution server.

I tried to find the solutions on google and follow them like including kie-ci-6.3.0.Final.jar in classpath. I have placed this file under tomcat lib folder. I am not sure if files(project JAR file) are available on remote server M2 repo, why it would not be available to server at runtime. What I am missing? 

Also, I don't see DRL file under JAR file when I build the project via workbench. I open JAR file to see and I only see model java file but not DRL file.

Can someone help me in resolving this issue?

Thanks
Sunil
KIE.jpg
m2Repo_ExecutionServer.jpg
m2Repo_WorkbenchServer.jpg

Eugene Shvartsman

unread,
Oct 13, 2015, 9:35:07 AM10/13/15
to Drools Setup, sunil...@gmail.com
Hey Sunil,

Does your jar file have a proper kmodule.xml in it? With the proper kbase name defined? 

Eugene

Sunil Sahu

unread,
Oct 13, 2015, 10:41:55 AM10/13/15
to Drools Setup, sunil...@gmail.com
Thanks for response Eugene. No, it doesn't. I have checked .m2/repository folder, under release version folder I see three files. 
_remote.repositories
PortfolioMonitor-3.0.jar
PortfolioMonitor-3.0.pom

When I opened this JAR file, I see only one class file which is for my model. I even don't see DRL file. I followed below step while working on this use case.
1. Created Organization Unit
2. Created Repository
3. Created Project
4. Created Model under this project
5. Created DRL file and validate it.
6. Build it and deployed it to container
7. I can see connectivity is established between KIE execution server and KIE workbench
9. I can see from KIE workbench that container has started
10. When I make a REST class from my rest client using KIE execution server, I see container coming as in failed status

I am sure I missing something during creation of project like kbase or session something but not sure.

Thanks
Sunil

Eugene Shvartsman

unread,
Oct 13, 2015, 10:44:32 AM10/13/15
to Drools Setup, sunil...@gmail.com
The kmodule.xml file would be inside of the jar file under META-INF.

Sunil Sahu

unread,
Oct 13, 2015, 10:52:19 AM10/13/15
to Drools Setup, sunil...@gmail.com
I see two folder under META-INF.

1. defaultKieBase
2. maven\package name\Project Name

but I don't see any xml file. I think I am missing kmodule.xml, I see in workbench documentation, there is a step for dependencies. Let me do that and I will let you know.

Thanks
Suni

Chirag Soni

unread,
Oct 14, 2015, 5:48:49 AM10/14/15
to Drools Setup, sunil...@gmail.com
Hi sunil and Edson
I am also getting the same issue no data available while creating container from workbench UI. I have deployed  kie-Workbench 6.3 & kie-Execution server  war file on WildFly 9.0 , Bothe are running on the same instance of wildFly.
i have already added few system properties on Standalone-full.xml which are mention below => 

<system-properties>
        <property name="org.uberfire.nio.git.dir" value="false"/>
        <property name="org.kie.demo" value="false"/>
        <property name="org.uberfire.nio.git.daemon.disables" value="true"/>
        <property name="org.kie.example" value="false"/>
 </system-properties>

So please any one can help me what all chenges required to resolve this issue . Sunil can you help me to do those change in WildFly which you did for tomcat .

Thanx in advance
 
Regard ,
Chirag Soni
 

 
issue.png

Sunil Sahu

unread,
Oct 14, 2015, 11:51:39 AM10/14/15
to Drools Setup, sunil...@gmail.com
Hi Chirag,

I resolved my 1st issue ("No Data available" for container) based on input given by Edson. I used property (-Dorg.kie.example=false) in tomcat instance where workbench was deployed. I used below set of properties on tomcat instance where KIE execution server was deployed.
I tried 6.2. version as well before I switched to 6.3.0 because of some issue so somehow I thought that I need two separate instances for workbench and execution server for 6.3 version but if you refer blog article by Maciej, it says you can use one instance for both deployment. By making above changes, my issue was resolved but I got stuck with another issue where container was failing when I was making REST call via KIE execution server. The issue was that KIE execution server which was running on different box couldn't locate objects. I have installed 2nd instance of tomcat on same box now where 1st instance of tomcat is running for workbench. I can see container running from REST call now.

I haven't tried above approach with JBoss because I have been using Tomcat only. You can get idea from Maciej blog, he wrote a very nice article (http://mswiderski.blogspot.com/2015/09/unified-kie-execution-server-part-1.html). Please follow these steps and I hope it will resolve your issue.

Thanks
Sunil

Sunil Sahu

unread,
Oct 14, 2015, 1:31:51 PM10/14/15
to Drools Setup, sunil...@gmail.com
Hello Maciej/Michael/Edson/Eugene/{Others}

I was able to resolve JAR file loading issue form m2 repo based on input from Eugene. Now I am running both tomcat instances on same server (previously I was using two instances on two different servers). 

Now I am having another issue while firing the rules from REST client. I pass below URL and content-type for REST call

URL: http://<ServerName>:9090/kie-server/services/rest/server/containers/instances/ContainerId
Content-Type: application/json
X-KIE-ContentType: json
Method: POST

I am passing below as Request Body content
{"batch-execution":{"lookup":"session1","commands":
[{"insert":{"object":{"demo.portfoliomonitor.Portfolio":{"country_count":1}}}},
{"fire-all-rules":""}]}}

I am getting below as error in Request Output.
{
"type" : "FAILURE",
"msg" : "Error calling container PortfolioMonitor3.1: org.kie.server.api.marshalling.MarshallingException: Error unmarshalling input",
"result" : null
}

In KIE execution tomcat log file, I see below error.
Caused by: org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "batch-execution" (Class org.drools.core.command.runtime.BatchExecutionCommandImpl), not marked as ignorable
 at [Source: java.io.StringReader@344396ad; line: 1, column: 21] (through reference chain: org.drools.core.command.runtime.BatchExecutionCommandImpl["batch-execution"])

So looks like it's complaining about "batch-execution" command which I passed as Request. I got this command from KIE Workbench documentation (Chapter 11, page# 377) as JSON input so I am not sure what mistake I am making. 

Can someone please look into this issue and provide some guidance to resolve the issue?

Thanks
Sunil

Maciej Swiderski

unread,
Oct 15, 2015, 6:38:37 AM10/15/15
to drools...@googlegroups.com, sunil...@gmail.com
Sunil,

try with following content:
{
"lookup":"session1,
"commands: [ {
  "insert":{"object":{"demo.portfoliomonitor.Portfolio":{"country_count":1}}}
},
{"fire-all-rules":”"}
] }

batch-execution is not needed - in case you use other types as root you can specify it’s type via header:
X-KIE-ClassType=org.drools.core.command.runtime.BatchExecutionCommandImpl

Maciej

--
You received this message because you are subscribed to the Google Groups "Drools Setup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-setup...@googlegroups.com.
To post to this group, send email to drools...@googlegroups.com.

Chirag Soni

unread,
Oct 16, 2015, 5:41:39 AM10/16/15
to Drools Setup, sunil...@gmail.com
Hi Sunil,

Thanks for your response, initially we have successfully able to deploy the war file of workbench in wild fly, we got a error saying "No data available". So we decided to go with the tomcat server.

Can you please help me regarding the tomcat server approach and FYI I have followed the (http://mswiderski.blogspot.com/2015/09/unified-kie-execution-server-part-1.html) blog but still facing the issues. Please find the attached for stack trace.

Rgds,
Chirag
catalina.2015-10-15.log
READMEDroolsWB 6.3.txt

Sunil Sahu

unread,
Oct 19, 2015, 12:07:09 PM10/19/15
to Drools Setup, sunil...@gmail.com
Thanks for response Maciej. I tried with JSON content you mentioned and I am getting different error now. I have already created knowledge base and session. I can see them defined in kmodule.xml but I don't know why it's complaining about session. Below is the content of kmodule.xml file.

Error with REST call:
    {
    "type" : "FAILURE",
    "msg" : "Session 'session1”,\n' not found on container 'PortfolioMonitor3.4'.",
    "result" : null
    }


kmodule.xml

  <kbase name="kbase" default="false" eventProcessingMode="cloud" equalsBehavior="equality" declarativeAgenda="enabled" packages="demo.portfoliomonitor">
    <ksession name="session1" type="stateful" default="true" clockType="realtime"/>
  </kbase>
</kmodule>

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
  <modelVersion>4.0.0</modelVersion>
  <groupId>demo.portfoliomonitor</groupId>
  <artifactId>PortfolioMonitor</artifactId>
  <version>3.4</version>
  <name>PortfolioMonitor</name>
  <dependencies>
    <dependency>
      <groupId>demo.portfoliomonitor</groupId>
      <artifactId>PortfolioMonitor</artifactId>
      <version>3.4</version>
    </dependency>
  </dependencies>
  <build>
    <sourceDirectory>src</sourceDirectory>
    <resources>
      <resource>
        <targetPath>.</targetPath>
        <directory>src/main/resources</directory>
        <includes>
          <include>META-INF/kmodule.xml</include>
          <include>demo/portfoliomonitor/PortfolioCountryCount.drl</include>
        </includes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.kie</groupId>
        <artifactId>kie-maven-plugin</artifactId>
        <version>6.3.0.Final</version>
        <extensions>true</extensions>
      </plugin>
    </plugins>
  </build>
</project>

Can you please help me in resolving this issue?

Thanks
Sunil


Maciej Swiderski

unread,
Oct 20, 2015, 7:57:12 AM10/20/15
to drools...@googlegroups.com, sunil...@gmail.com
A new blog was published that details steps to install KIE Server and Workbench on same server (Wildfly and Tomcat):

Hope it helps
Maciej
--
You received this message because you are subscribed to the Google Groups "Drools Setup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-setup...@googlegroups.com.
To post to this group, send email to drools...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
<catalina.2015-10-15.log><READMEDroolsWB 6.3.txt>

Sunil Sahu

unread,
Oct 20, 2015, 9:42:47 AM10/20/15
to Drools Setup, sunil...@gmail.com
Hello Chirag,

You can follow steps given in new link for setup on Tomcat (same instance for both workbench and execution server)


Thanks
Sunil

Sunil Sahu

unread,
Oct 20, 2015, 9:44:13 AM10/20/15
to Drools Setup, sunil...@gmail.com
Hi Maciej,

I don't have setup issue, I have setup both workbench and execution server on two tomcat instances. I am having issue while making REST call from execution server to fire the rules on my JSON dataset. Can you help me in resolving this issue?

Thanks
Sunil

Maciej Swiderski

unread,
Oct 20, 2015, 1:49:20 PM10/20/15
to drools...@googlegroups.com, sunil...@gmail.com
Sunil,

the problem is with wrong quote character:

{
"lookup":"session1,
"commands: [ {
  "insert":{"object":{"demo.portfoliomonitor.Portfolio":{"country_count":1}}}
},
{"fire-all-rules":"}
] }

double check they are all properly set and you should make it to work.

Maciej

Sunil Sahu

unread,
Oct 20, 2015, 4:35:47 PM10/20/15
to Drools Setup, sunil...@gmail.com
Thanks Maciej, I didn't realize that quote got messed up during copy/paste. I was able to fire the rule on my JSON data after making this change. Thanks for your help.

Thanks
Sunil

Sunil Sahu

unread,
Oct 20, 2015, 4:43:47 PM10/20/15
to Drools Setup, sunil...@gmail.com
Thanks Maciej for another nice write-up. I have setup both workbench and execution server on Tomcat 8.0.8 as per instruction given in blog but I was getting memory leak issue. I have attached log for your reference.

I tried same setup on Tomcat 7.0.63 and I was able to run workbench and execution server on same tomcat instance. I got another issue (Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalStateException: Cannot find ksession, either it does not exist or there are multiple default ksession in kmodule.xml) on this setup but that's different question. I might have missed something or messed up something while creating my use case on this instance but atleast environment was working fine. I got this error when I was building my project using "Build and Deploy" option. I see kmodule.xml has one entry for ksession so not sure about this error.

Thanks
Sunil

On Tuesday, October 20, 2015 at 7:57:12 AM UTC-4, Maciej Swiderski wrote:
catalina.2015-10-20.log

Sunil Sahu

unread,
Oct 22, 2015, 11:56:48 AM10/22/15
to Drools Setup, sunil...@gmail.com
Hi Maciej

As I mentioned before, I was able to fire rule on my JSON input when I passed only one record. I am now trying to pass list of data as JSON input. I have created below JSON input with help of chapter 11 in documentation (11.2.6. InsertElementsCommand) but it's failing with "org.kie.server.api.marshalling.MarshallingException: Error unmarshalling input" error. Can you please help me with syntax if something is wrong? I have removed "batch-execution" from syntax. Also, Is there any article which I can refer to how result can be stored to database after firing rules on dataset?

Input JSON:

{
"lookup":"session1",
"commands":{
"insert-elements":{
"objects":[
{"containedObject":{"@class":"demo.portfoliomonitor.Portfolio","country":"USA","country_count":5}},
{"containedObject":{"@class":"Portfolio","country":"India","country_count":7}},
{"containedObject":{"@class":"Portfolio","country":"China","country_count":2}}
]
}
}
}


Thanks
Sunil

Maciej Swiderski

unread,
Oct 23, 2015, 7:14:50 AM10/23/15
to drools...@googlegroups.com, sunil...@gmail.com
Sunil,

to produce valid JSON string for kie server simply use JSON marshaller that comes with kie-server-api and that will save you lot’s of time to figure out that is expected format. Here you have a bit of source code that shows how to use it:

Marshaller marshaller = MarshallerFactory.getMarshaller(extraClasses, MarshallingFormat.JSON, classLoader);

List<Command<?>> commands = new ArrayList<Command<?>>();
BatchExecutionCommand batchExecution = commandsFactory.newBatchExecution(commands, "ksession-name");

commands.add(commandsFactory.newInsert(object, id));

List<Object> people = new ArrayList<Object>();
people.add(person);
people.add(person2);
people.add(person3);
commands.add(commandsFactory.newInsertElements(people, "list-id"));

commands.add(commandsFactory.newFireAllRules());

String jsonContent = marshaller.marshall(batchExecution);

extra classes and class loader in first line is important when you use custom classes that are from your model or so. So make sure you at them there to ensure marshaller has all required information.
With commandsFactory you can build any command that can be sent to KIE Server.

Hope this helps
Maciej

Sundar M

unread,
Dec 1, 2015, 4:02:54 AM12/1/15
to Drools Setup, sunil...@gmail.com
Hi team,

I am also facing the same problem "no end points". I have set the following properties in eap 6.4 server where I have deployed my kieserver and kie workbench.

Help me on Identifying the problem.

Thanks

masoud jabbarvand

unread,
Feb 23, 2016, 3:17:05 AM2/23/16
to Drools Setup, sunil...@gmail.com
Hi sunil
I am in the same problem now. i install WB and EX server on different tomcat instances (on windows). but WB cant recognize EX server and 'end point" is empty when i register kie-server in Rule Deployment.
could you tell me how is your catalina.bat file for each of WB and EX server?

king regards

در پنجشنبه 8 اکتبر 2015، ساعت 18:34:53 (UTC+3:30)، Sunil Sahu نوشته:

Sunil Sahu

unread,
Feb 23, 2016, 9:42:29 AM2/23/16
to Drools Setup, sunil...@gmail.com
Hi Masoud,

I had workbench running on Tomcat 7 default port 8080 and KIE execution server  running on second instance of Tomcat 7 port 9090. I kept workbench war as workbench.war in webapps folder and KIE war as kie-server.wa in webapps folder. You can set below line in your corresponding catalina.bat file and it should work.

KIE Execution server
set CATALINA_OPTS=-Xmx512M -XX:MaxPermSize=512m -Dbtm.root=%CATALINA_HOME%\ -Dbitronix.tm.configuration=%CATALINA_HOME%\conf\btm-config.properties\  -Djbpm.tsr.jndi.lookup=java:comp/env/TransactionSynchronizationRegistry\ -Dorg.jboss.logging.provider=jdk -Dorg.kie.demo=false -Dorg.kie.server.location=http://<YourServerName>:9090/kie-server/services/rest/server -Dorg.kie.server.id=first-kie-server -Dorg.kie.server.controller=http://<YourServerName>:8080/workbench/rest/controller


KIE Workbench
set CATALINA_OPTS=-Xmx768M -XX:MaxPermSize=768m -Dbtm.root=%CATALINA_HOME%\ -Dbitronix.tm.configuration=%CATALINA_HOME%\conf\btm-config.properties\  -Djbpm.tsr.jndi.lookup=java:comp/env/TransactionSynchronizationRegistry\  -Djava.security.auth.login.config=%CATALINA_HOME%\webapps\workbench\WEB-INF\classes\login.config\ -Dorg.jboss.logging.provider=jdk -Dorg.kie.demo=false -Dorg.kie.example=false

I hope it helps.

Thanks
Sunil

masoud jabbarvand

unread,
Feb 29, 2016, 7:44:44 AM2/29/16
to Drools Setup, sunil...@gmail.com
Hi and very Thanks Sunil.
thats very useful.
my problem was that i changed the default Database H2 to postgresql and kieWB and kieEX not recognized that! so I changed to H2 and it works for me. I didnt know what was the problem!
but, now i try WB and EX on same server (Tomcat 7.0) following Maciej's blog and it works. and when i try this part of blog (http://mswiderski.blogspot.co.uk/2015/09/unified-kie-execution-server-part-1.html):
Endpoint:
Method:
  • POST
Request body:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<map-type>
    <entries>
        <entry>
            <key>age</key>
            <value xsi:type="xs:int" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">25</value>
        </entry>
        <entry>
            <key>name</key>
            <value xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">john</value>
        </entry>
    </entries>
</map-type>

 i face below problem!

HTTP Status 415 - RESTEASY001055: Cannot consume content type.

The server refused this request because the request entity is in a format
not supported by the requested resource for the requested method.

so do you know what is the problem.


در سه‌شنبه 23 فوریهٔ 2016، ساعت 18:12:29 (UTC+3:30)، Sunil Sahu نوشته:

manish.g...@gmail.com

unread,
Apr 22, 2016, 4:24:42 AM4/22/16
to Drools Setup, sunil...@gmail.com
Hi,

Can any one please help me to resolve issue  I am facing in installation of  kie server 6.3.0 on tomcat 7.0.27.

I have followed the steps shared by Sunil (as I am also having my Kie server and Kie workbench on different tomcat instance)

server war has deployed successfully. But when I am trying to access this it gives exception and seems server id is passing null however 

I have added variable 

-Dorg.kie.server.id=first-kie-server

in my Catalina.bat file.

java.lang.NullPointerException
	java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:782)
	org.kie.server.services.impl.storage.file.KieServerStateFileRepository.load(KieServerStateFileRepository.java:73)
	org.kie.server.services.impl.KieServerImpl.<init>(KieServerImpl.java:86)
	org.kie.server.services.impl.KieServerLocator.<clinit>(KieServerLocator.java:20)
	org.kie.server.remote.rest.common.KieServerApplication$1.<init>(KieServerApplication.java:43)
	org.kie.server.remote.rest.common.KieServerApplication.<init>(KieServerApplication.java:40)

Sunil Sahu

unread,
Apr 22, 2016, 9:08:58 AM4/22/16
to manish.g...@gmail.com, Drools Setup
Can you share catalina.bat from both tomcat instances running kie server and workbench? Its something to do with setup only.

Thanks
Sunil


--

Thanks & Regards
Sunil Sahu

manish.g...@gmail.com

unread,
Apr 27, 2016, 5:00:19 AM4/27/16
to Drools Setup, manish.g...@gmail.com
Thanks a lot Sunil for the reply. I am attaching here catalina.bat file from both server. Your suggestion would be great help for me.
catalina.bat_kieserver
catalina.bat_kieworkbench
Reply all
Reply to author
Forward
Message has been deleted
0 new messages