发布Drools Workbench到Tomcat on Linux

1.下载Tomcat7.XX+,并解压缩tomcat

 

2. 从Drools 官网下载最新的tomcat war包 kie-drools-wb-6.3.0.Final-tomcat7.war copy war包到 TOMCAT_HOME/webapps

 

3. 把以下lib拷贝到Tomcat TOMCAT_HOME/lib目录下面

    * btm-2.1.4.jar

    * btm-tomcat55-lifecycle-2.1.4.jar

    * h2-1.3.161.jar

    * jta-1.1.jar

    * slf4j-api-1.7.2.jar

* slf4j-jdk14-1.7.2.jar

* kie-tomcat-integration-6.3.0.Final.jar

* javax.security.jacc-api-1.5.jar

 

4.创建配置文件btm-config.properties 并拷贝到TOMCAT_HOME/conf,可以把以下内容直接拷贝到btm-config.properties文件里面

 

 ************************ sample btm-config.properties *************************

 bitronix.tm.serverId=tomcat-btm-node0

 bitronix.tm.journal.disk.logPart1Filename=${btm.root}/work/btm1.tlog

 bitronix.tm.journal.disk.logPart2Filename=${btm.root}/work/btm2.tlog

 bitronix.tm.resource.configuration=${btm.root}/conf/resources.properties

 

5. 创建配置文件 resources.properties,并拷贝到TOMCAT_HOME/conf, 可以把以下内容直接拷贝到resources.properties文件里面

 ************************ sample resources.properties **************************

         resource.ds1.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource

         resource.ds1.uniqueName=jdbc/jbpm

         resource.ds1.minPoolSize=10

         resource.ds1.maxPoolSize=20

         resource.ds1.driverProperties.driverClassName=org.h2.Driver

         resource.ds1.driverProperties.url=jdbc:h2:file:~/jbpm

         resource.ds1.driverProperties.user=sa

         resource.ds1.driverProperties.password=

         resource.ds1.allowLocalTransactions=true

 

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

create setenv.sh (or setenv.bat) file inside TOMCAT_HOME/bin and add following:

***********************************setenv.sh****************************

#!/bin/sh

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    -Djava.security.auth.login.config=$CATALINA_HOME/webapps/kie-drools-wb/WEB-INF/classes/login.config -Dorg.jboss.logging.provider=jdk"

 NOTE: this is an example for unix like systems for Windows $CATALINA_HOME needs to be replaced with windows env variable or absolute path

    NOTE: java.security.auth.login.config value includes name of the folder in which application is deployed by default it assumes kie-drools-wb so ensure that matches real installation.

    login.config file can be externalized as well meaning be placed outside of war file.

 

7.Add valve configuration into TOMCAT_HOME/conf/server.xml inside Host element as last valve definition:

  <Valve className="org.kie.integration.tomcat.JACCValve" />

 

8.Edit TOMCAT_HOME/conf/tomcat-users.xml to include roles and users, make sure there will be 'analyst' or 'admin' roles defined as it's required to be authorized to use kie-wb

 

9. Now you can start tomcat and access drools workbench

posted @ 2016-01-12 16:07  fourseasonzl  阅读(705)  评论(0编辑  收藏  举报