jbpm4.3 环境搭建

我们下载了jbpm4.3之后,在建立自己的jbpm web工程时,往往要使用mysql、oracle数据库,而非例子中的内存数据库。以下是我的搭建经历。

1、建mysql数据库

2、使用mysql图形化工具导入见表脚本,路径在jBPM4.3\jbpm-4.3\install\src\db\create下的mysql脚本

3、建立一个jbpm工程,默认使用jbpm4.3的hibernate配置文件,当然要先替换掉默认的内存数据库hsqldb,改为我们的mysql数据库。然后启动工程。

这时候发现eclipse控制台打印出异常如下:

严重: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1 executioni0_.DBID_ as DBID1_3_, executioni0_.DBVERSION_ as DBVERSION3_3_, exec' at line 1
2012-3-30 0:00:57 org.jbpm.internal.log.Jdk14Log info
信息: exception while executing command org.jbpm.pvm.internal.cmd.CheckDbCmd@ad8848
org.jbpm.api.JbpmException: no jBPM DB schema: no JBPM4_EXECUTION table.   Run the create.jbpm.schema target first in the install tool.

这个问题的是由于你没有替换hibernate.dialect,需要由原来的 org.hibernate.dialect.HSQLDialect 替换为

org.hibernate.dialect.MySQLInnoDBDialect

这样启动就不会报错了。

至此,我们就可以在mysql数据库中查看流程数据了。摆脱了内存数据库。

运行我们的应用,发现写到数据库中有乱码,这个时候,请保证以下几处的编码都保持一致:

mysql安装的默认编码
页面的编码
请求的编码
URLEncode的编码
都用UTF-8

其中说到的URLEncode的编码 ,是指配置数据源的时候,指定mysql的url时传递的参数。

注意这个地址中的分号一定要转意,否则会报出如下错误:The reference to entity "characterEncoding" must end with the ';' delimiter.

猜你喜欢

转载自gds-fighting.iteye.com/blog/1469362