The Purpose of this Post
This post is an example of an easy setup of Drools KIE WorkBench and KIE Server in one WildFly server instance.
Note 1: These notes use WildFly 8.2.1 for compatibility with Drools 6.4.0. Adjust the paths accordingly for a different version.
Note 2: These instructions use Windows syntax for directories but the steps are the same for Linux.
Install WildFly
If you don’t have WildFly installed, these instructions may help.
There is no need to have WildFly running when installing and configuring KIE products. If you have it running, ignore the errors until completing configuration.
KIE WorkBench
Download Drools KIE WorkBench 6.4.0
Copy the war file to C:\apps\wildfly-8.2.1.Final\standalone\deployments\ directory. WildFly will auto deploy it when started (or nearly immediately if it is already running).
KIE Server
Download Drools KIE Server 6.4.0
Extract kie-server-6.4.0.Final-ee7.war from the zip.
Copy the war file to C:\apps\wildfly-8.2.1.Final\standalone\deployments\ directory. WildFly will auto deploy it when started (or nearly immediately if it is already running).
Add Users
KIE WorkBench and KIE Server require roles for various privileges. For our quick setup, create a user named “kieserver” with same word as password and roles for all privileges.
To do so, run this command in the WildFly bin directory:
add-user -a -u kieserver -p kieserver -ro admin,kie-server,rest-all,kiemgmt
Consider creating separate users – one for KIE Server and KIE WorkBench communication (as above) and one for each human user to author rules (the user ids).
Configure
While configuring the KIE products isn’t difficult, I’ve seen many people miss settings or have wrong values for settings and then struggle with what is wrong. This is the key reason for this post – a nutshell of correct settings for a fast and simple setup.
One of the easier ways to configure apps in WildFly is using the conf files in the WildFly bin directory. Add these config items towards the top of the C:\apps\wildfly-8.2.1.Final\bin\standalone.conf.bat file.
For clarity, I make a separate environment variables for each item.
KIE Server requires the full WildFly config:
set SERVER_CONFIG=--server-config=standalone-full.xml
Establish the user ids and passwords for KIE Server and KIE WorkBench communication. For our quick setup, use the same user for both needs; use the user created earlier:
set KIE_SERVER_USER=-Dorg.kie.server.user=kieserver set KIE_SERVER_PWD=-Dorg.kie.server.pwd=kieserver set KIE_CONTROLLER_USER=-Dorg.kie.server.controller.user=kieserver set KIE_CONTROLLER_PWD=-Dorg.kie.server.controller.pwd=kieserver
Establish the URLs for KIE WorkBench controller and KIE Server REST:
set KIE_CONTROLLER_URL=http://localhost:8080/kie-drools-wb-distribution-wars-6.4.0.Final-wildfly8/rest/controller set KIE_SERVER_URL=http://localhost:8080/kie-server-6.4.0.Final-ee7/services/rest/server set KIE_SERVER=-Dorg.kie.server.location=%KIE_SERVER_URL% set KIE_CONTROLLER=-Dorg.kie.server.controller=%KIE_CONTROLLER_URL%
Establish the name of the KIE Server. When creating a “server template” in KIE WorkBench, its name must match the name of a KIE Server id. Also, the KIE WorkBench displays this name for the KIE Server when the KIE Server connects to the KIE WorkBench:
set KIE_SERVER_ID=-Dorg.kie.server.id=wildfly-kieserver
WildFly uses an environment variable named SERVER_OPTS for configuration options, so concatenate the individual environment variables into it:
set SERVER_OPTS=%SERVER_CONFIG% %KIE_SERVER_USER% %KIE_SERVER_PWD% %KIE_CONTROLLER_USER% %KIE_CONTROLLER_PWD% %KIE_SERVER% %KIE_CONTROLLER% %KIE_SERVER_ID%
(don’t forget to save the file!)
Run and Verify
Start (or restart) WildFly and monitor the log messages for errors.
Note: until the KIE WorkBench is fully started, the KIE Server cannot connect to it and it emits a 405 connection problem until it can. This message stops once they are both running, if it doesn’t then you have a config issue.
If working correctly, this URL shows the KIE WorkBench login page: http://localhost:8080/kie-drools-wb-distribution-wars-6.4.0.Final-wildfly8/
Login with a user id and password created above.
If the login page does not appear, then review the WildFly server log and the deployment status files in the standalone dir.
This REST URL shows the KIE Server status: http://localhost:8080/kie-server-6.4.0.Final-ee7/services/rest/server/
This REST URL shows the KIE Server containers configured to it: http://localhost:8080/kie-server-6.4.0.Final-ee7/services/rest/server/containers
KIE WorkBench and KIE Server have many REST URLs to work with, so explore the Drools docs to see them.
Hopefully these steps helped your quick setup of the Drools KIE WorkBench and KIE Server. Please let me know if I can expand on any of them for clarity.
Hi Jeff,
I am trying to install Drools 6.5.0 WB and Server in Wildfly 10.1 server and having issues with it. I followed exactly all the steps you mentioned in this blog but yet unsuccessful. Below is the error message I see in the logs. Appreciate if you can share your thoughts to resolve this issue.
12:16:14,471 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0190: Step handler org.jboss.as.server.DeployerChainAddHandler$FinalRuntimeStepHandler@374ab516 for operation {“operation” => “add-deployer-chains”,”address” => []} at address [] failed handling operation rollback — java.util.concurrent.TimeoutException: java.util.concurrent.TimeoutException
at org.jboss.as.controller.OperationContextImpl.waitForRemovals(OperationContextImpl.java:498)
at org.jboss.as.controller.AbstractOperationContext$Step.handleResult(AbstractOperationContext.java:1369)
at org.jboss.as.controller.AbstractOperationContext$Step.finalizeInternal(AbstractOperationContext.java:1328)
at org.jboss.as.controller.AbstractOperationContext$Step.finalizeStep(AbstractOperationContext.java:1301)
at org.jboss.as.controller.AbstractOperationContext$Step.access$300(AbstractOperationContext.java:1185)
at org.jboss.as.controller.AbstractOperationContext.executeResultHandlerPhase(AbstractOperationContext.java:767)
at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:644)
at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:370)
at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1329)
at org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.java:493)
at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:387)
at org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:349)
at org.jboss.as.server.ServerService.boot(ServerService.java:397)
at org.jboss.as.server.ServerService.boot(ServerService.java:366)
at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:299)
at java.lang.Thread.run(Thread.java:748)
Not much info there to help understand the problem. Is this starting KWB or KES? How are you starting it? Stacktrace shows a timeout, so the question is what timed out waiting for what…
We currently have the workbench and kieserver running on a development box. We are planning on setting up a production server. What is best practice for moving projects from DEV to PROD?
Thanks in advance for your help.
Rob Hammons
Hi Rob,
“Best practice” is deploying the built kjars to each KES. So
that means one KWB (in a production mode) and multiple KES (one or more
for dev, one or more for qa, one or more for prod, etc.). The KWB is
just like a source control server – one instance, not multiple; not one
for dev, one for qa, and one for prod, etc. As I often explain, “there
is no dev KWB just like there is no dev git server; it’s all prod”.
When
I setup a second KWB with my customers, it’s a “sandbox” for people to
try things out risk free (great for learning mode), and not pollute the
prod KWB with them. No rules/projects are “moved” from it to the prod
instance tho.
Let me know if that helps…
Hey Jeff,
I am using 7.59.0 version. will the setup changes for that?
Hi Venkat, I have not tried that version – please do and let us know!
Hi, can I have one KWB installed on one machine and multiple Kie Execution Server on different machines and talk to KWB?
Yes, that is a typical installation.