需要修改jbpm-installer目录下的配置文件
db/persistence.xml
task-service/resources/META-INF/persistence.xml
db/jBPM-ds.xml 如果你使用的JBoss版本是 as5的话
standalone.xml 如果你使用的JBoss版本是 as7的话
db/persistence.xml:
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
改为
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
task-service/resources/META-INF/persistence.xml:
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
<property name="hibernate.connection.driver_class" value="org.h2.Driver"/>
<property name="hibernate.connection.url" value="jdbc:h2:tcp://localhost/runtime/task" />
<property name="hibernate.connection.username" value="sa"/>
<property name="hibernate.connection.password" value="sasa"/>
改为
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/task" />
<property name="hibernate.connection.username" value="task"/>
<property name="hibernate.connection.password" value="task"/>
db/jBPM-ds.xml:
<datasources>
<local-tx-datasource>
<jndi-name>jboss/datasources/jbpmDS</jndi-name>
<connection-url>jdbc:h2:tcp://localhost/runtime/jbpm-demo</connection-url>
<driver-class>org.h2.jdbcx.JdbcDataSource</driver-class>
<user-name>sa</user-name>
<password></password>
</local-tx-datasource>
</datasources>
改为
<datasources>
<local-tx-datasource>
<jndi-name>jboss/datasources/jbpmDS</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/jbpm5</connection-url>
<driver-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</driver-class>
<user-name>jbpm5</user-name>
<password>jbpm5</password>
</local-tx-datasource>
</datasources>
standalone.xml:
<subsystem xmlns="urn:jboss:domain:datasources:1.0">
<datasources>
<datasource jndi-name="java:jboss/datasources/jbpmDS" enabled="true" use-java-context="true" pool-name="H2DS">
<connection-url>jdbc:h2:tcp://localhost/runtime/jbpm-demo</connection-url>
<driver>h2</driver>
<pool></pool>
<security>
<user-name>sa</user-name>
<password></password>
</security>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
改为
<subsystem xmlns="urn:jboss:domain:datasources:1.0">
<datasources>
<datasource jndi-name="java:jboss/datasources/jbpmDS" pool-name="H2DS" enabled="true" use-java-context="true">
<connection-url>jdbc:mysql://localhost:3306/jbpm5</connection-url>
<driver>mysql</driver>
<pool></pool>
<security>
<user-name>jbpm5</user-name>
<password>jbpm5</password>
</security>
</datasource>
<drivers>
<driver name="mysql" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
启动demo
如果你没有安装过demo可以执行下面的命令
ant install.demo.db
如果你已经安装了demo并且正在运行运行下面的命令
ant clean.demo; ant install.demo.db
当你完成了上面的工作后,使用下面的命令启动demo
ant start.demo.db
你可以用以下命令停止demo
ant stop.demo.db