环境 win10+jdb1.8+tomcat7(解压版)+kie-drools-wb-6.5.0.Final-tomcat7.war
1.下载kie-drools-wb-6.5.0.Final-tomcat7.war,http://www.drools.org/
2.打开其中的README.txt
按照文档操作即可
注意
1.
NOTE: jdbc/jbpm is the JNDI name used by tomcat distribution of the application
3. 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:
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: On Debian based systems $CATALINA_HOME needs to be replaced with $CATALINA_BASE. ($CATALINA_HOME defaults to /usr/share/tomcat7 and $CATALINA_BASE defaults to /var/lib/tomcat7/)
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.
这个配置方式是针对for unix操作系统的
如果是windows,需要调整下语法结构,原因见 bat语法
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/WEB-INF/classes/login.config -Dorg.jboss.logging.provider=jdk -Dorg.uberfire.async.executor.safemode=true
注意不可换行,且额外增加了(为什么要增加这个,未搞明白具体原因,需要进一步研究)
-Dorg.uberfire.async.executor.safemode=true
如果没有,会报错:
警告: Unable to instantiate EJB Asynchronous Bean. Falling back to Executors' CachedThreadPool.
javax.naming.NameNotFoundException: Name [module/SimpleAsyncExecutorService] is not bound in this Context. Unable to find [module].
2.注意设置环境变量
CATALINA_HOM
否则就找不到setenv.sh(setenv.bat)中配置的文件的路径
3.系统默认的是采用嵌入式数据H2做数据持久化存储的,如果想看H2中具体生产的有哪些表可以借助h2的客户端可视化工具,本人采用的是h2自带的web可视化工具。下载地址:http://www.h2database.com/html/download.html
安装之后
打开即可
注意:
1. jdbc数据库URL:jdbc:h2:~/test (test为h2 database默认提供的测试数据库)
而我们配置的为:
jdbc:h2:file:~/jbpm
将test修改为jbpm 点击connect进入即可看到默认生产了一系列的表。
具体生产方式见:
$CATALINA_HOME/webapps/kie-drools-wb/WEB-INF/classes/META-INF/persistence.xml
中的配置
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup"/>
<!-- BZ 841786: AS7/EAP 6/Hib 4 uses new (sequence) generators which seem to cause problems -->
<property name="hibernate.id.new_generator_mappings" value="false"/>
</properties>
注意,此h2 web数据库查看窗口不可与workbench应用一起打开运行,否则,打开h2 web查看页面再打开workbench应用后,应用会报错:
Caused by: org.h2.jdbc.JdbcSQLException: IO Exception: "java.io.IOException: 另一个程序已锁定文件的一部分,进程无法访问。"; "C:/Users/Administrator/jbpm.h2.db" [90031-161]
原因:因为jbpm.h2.db被另一个程序锁了(被h2 web占用了,workbench无法使用),关闭 h2 web页面重启应用即可恢复。
至此,启动tomcat即可操作workbench 了,不过查看日志发现其中还有一些警告:
警告: Disabling JMS support in executor because: unable to initialize JMS configuration for executor due to Name [JmsXA] is not bound in this Context. Unable to find [JmsXA].
警告: executing transaction with 0 enlisted resource
警告: Environment variable M2_HOME is not set
此警告配置环境变量即可,问题不大,上面两个具体原因正在分析中......
另外,db为mysql的配置正在准备中。。。