Search code examples
javatomcat7droolskie

Cannot make kie-drools-workbench-6.2 work on tomcat 7


I need to use features provided by drools workbench, such as guided rule editor, but it's really frustrating to deploy it on tomcat.

Having done the following steps with the introduction of README.txt, I can see "Server startup in 45906ms" at the end of pop-up cmd window. But the web is totally blank as I visit http://localhost:8080/. Any ideas?

  1. Install bitronix transaction manager into your tomcat 7

I download the following jars separately, and put them in TOMCAT_HOME/lib.

btm-2.1.4.jar
btm-tomcat55-lifecycle-2.1.4.jar
h2-1.3.176.jar
jta-1.1.jar
slf4j-api-1.7.5.jar
slf4j-jdk14-1.7.2.jar
  1. Create configuration files inside TOMCAT_HOME/conf

Create btm-config.properties and resources.properties, and put the lines in README.txt to the files respectively.

  1. Define system properties for btm.root, bitronix config file, JBoss logging provider and others.

Create setenv.bat file inside TOMCAT_HOME/bin and add following (NOTE I put all the options in one line):

set CATALINA_OPTS=-Xms512M -Xmx1024M -XX:MaxPermSize=512m -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/kie-drools-wb-distribution-wars-6.2.0.Final-tomcat7/WEB-INF/classes/login.config -Dorg.jboss.logging.provider=jdk
  1. Configure JEE security for kie-wb on tomcat (with default realm backed by tomcat-users.xml)

2a~2c. As said in the README.txt (Copy "kie-tomcat-integration" JAR, "JACC" JAR, "slf4j-api" JAR (Isn't it the same as the one needed in Step 1?) into TOMCAT_HOME/lib), I downloaded kie-tomcat-integration-6.2.0.Final.jar, javax.security.jacc-api-1.5.jar separately, and put them in TOMCAT_HOME/lib.

2d. Just copy valve configuration the specified location.

2e. Edit TOMCAT_HOME/conf/tomcat-users.xml as follows:

...
<role rolename="admin"/>
<user username="drools_tomcat" password="111" roles="admin"/>
</tomcat-users>

I thought I finished my configuration here. Also, I've read through related questions, such as

kie workbench deploy war not working (tomcat),

drools 6.0.1 workbench cannot deploy to tomcat7.0,

how i deploy kie-drools-wb 6.2.0 with tomcat7?,

I also checked the link Deploying kie-drools-wb on Tomcat. But they seems not applicable to my case.


Solution

  • I started up the workbench finally!

    BTW, I modify TOMCAT_HOME/conf/tomcat-users.xml shown below, (refer to this web, may not be necessary), and then I can get access to workbench with user1 (password user1, as is set).

    <role rolename="admin"/> <!-- Tomcat Admin role -->
    <role rolename="analyst"/> <!-- Kie Workbench Analyst role. -->
    <role rolename="kie-server"/> <!-- Kie Drools Execution Server role. Needed to make REST Rules execution request -->
    <user username="admin" password="admin" roles="manager-gui,manager-script" /> <!-- Tomcat Admin user -->
    <user username="user1" password="user1" roles="admin, kie-server" />