3
votes

We are exploring Drools BPM for one of our new project. I am basically from .Net background and doesn't have much knowledge with java techs.

Our expectation is that we should able to create rules and workflows using Drools so that it can be exposed as REST API's and then the rules should be executed from .net/angular client applications using this REST.

I have configured the KIE server using WildFly10 server. It seems that all my configurations are working fine but when i try to connect to controller ("http://localhost:8080/kie-wb/rest/controller") it gives the below error message.

Error Message : 
2018-01-22 12:30:09,263 INFO  [org.kie.server.controller.websocket.client.WebSocketKieServerControllerImpl] (KieServer-ControllerConnect) Kie Server points to non Web Socket controller 'http://localhost:8080/kie-wb/rest/controller', using default REST mechanism
2018-01-22 12:30:09,263 WARN  [org.kie.server.common.KeyStoreHelperUtil] (KieServer-ControllerConnect) Unable to load key store. Using password from configuration
2018-01-22 12:30:09,274 WARN  [org.kie.server.services.impl.controller.DefaultRestControllerImpl] (KieServer-ControllerConnect) Exception encountered while syncing with controller at http://localhost:8080/kie-wb/rest/controller/server/wildfly-kieserver error Error while sending PUT request to http://localhost:8080/kie-wb/rest/controller/server/wildfly-kieserver response code 405

The below URL's are working fine

http://localhost:8080/kie-wb

http://localhost:8080/kie-server/services/rest/server/

http://localhost:8080/kie-wb/rest/controller/management/servers

2

2 Answers

4
votes

I was able to get both workbench and kie server to work on the same web and/or app server following various examples that are proliferated on the internet. However, I encountered this particular error when setting up for a more realistic production ready environment using separate app servers on the same host running on different ports. The issue is, the REST version of the url is only supported when both workbench and kie server are running on the same app or web server. When on separate app or web servers, it must use web sockets (see docs for property org.kie.workbench.controller):

http://docs.jboss.org/drools/release/7.8.0.Final/drools-docs/html_single/#_wb.systemproperties

Only Web Socket protocol is supported for connecting with a remote Kie Server Controller. When specifying this proporty, the Workbench will automatically disable all the features related to running the embbeded controller.

After reading this, the 405 makes sense (method not allowed). I changed the URL from

http://ACTUAL_HOST_NAME:8080/kie-drools-wb/rest/controller

to

ws://ACTUAL_HOST_NAME:8080/kie-drools-wb/websocket/controller

and that resolved the 405.

Also, I was originally using 'localhost' for the actual host name, but it still would not connect, so I changed it to the actual host name. Finally, I was still seeing a connection problem and then found out that both servers need

-Dorg.kie.workbench.controller.user=kieserver
-Dorg.kie.workbench.controller.pwd=kieserver1!
-Dorg.kie.server.user=kieserver
-Dorg.kie.server.pwd=kieserver1!

to be set on both servers (See https://groups.google.com/d/msg/drools-setup/Bpt-r_bIa2U/g0H1J77sBgAJ and https://groups.google.com/d/msg/drools-setup/Aru_F98nL9g/Z6vUCm6hBQAJ).

Edit:

After fiddling with it some more and read the documentation a little bit more, the referenced documentation was referring to workbench connecting to an external controller, instead of configuring the controller within workbench.

0
votes

After much torment, my problem was solved by adding role "kieserver=kie-server,rest-all" and user "kieserver" to Business Central Workbench.

Without this data, I consistently received 405.