2019独角兽企业重金招聘Python工程师标准>>>
经过一晚上的折腾,终于搞定,成功切换Mysql
步骤一:
安装mysql 数据库 创建数据库 名字为jbpm 设置用户名密码 我本地默认使用 root
步骤二:
** 修改配置文件 **
F:\jbpm-6.5.0.Final-installer-full\jbpm-installer下 standalone-full-wildfly-10.0.0.Final.xml 和 standalone-wildfly-10.0.0.Final.xml
由于根据官网 我本地下载的jboss服务器是 widfly10 所以 只需要修改上面的配置文件就可以了,然后 当用ant命令时,ant会自动把这2个文件的内容复制到 F:\jbpm-6.5.0.Final-installer-full\jbpm-installer\wildfly-10.0.0.Final\standalone\configuration 中
两个文件作同样的修改。
修改前
<datasources><datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true"><connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url><driver>h2</driver><security><user-name>sa</user-name><password>sa</password></security></datasource><datasource jta="true" jndi-name="java:jboss/datasources/jbpmDS" pool-name="H2DS" enabled="true" use-java-context="true" use-ccm="true"><connection-url>jdbc:h2:tcp://localhost/~/jbpm-db;MVCC=TRUE</connection-url><driver>h2</driver><security><user-name>sa</user-name></security></datasource><drivers><driver name="h2" module="com.h2database.h2"><xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class></driver></drivers></datasources>
修改后
<datasources><datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true"><connection-url>jdbc:mysql://localhost:3306/jbpm</connection-url><driver>mysql</driver><security><user-name>root</user-name><password>root</password></security></datasource><datasource jta="true" jndi-name="java:jboss/datasources/jbpmDS" pool-name="MySQLDS" enabled="true" use-java-context="true" use-ccm="true"><connection-url>jdbc:mysql://localhost:3306/jbpm</connection-url><driver>mysql</driver><security><user-name>root</user-name><password>root</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>
步骤三:
修改配置文件
F:\jbpm-6.5.0.Final-installer-full\jbpm-installer\db 下 的 jbpm-persistence-JPA2.xml 和 mysql_module.xml
jbpm-persistence-JPA2.xml 中
修改前
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
修改后
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
mysql_module.xml 中
**修改前 **
<resource-root path="mysql-connector-java.jar"/>
修改后
官网:this file is called db/mysql_module.xml. Open this file and make sure that the file name of the driver jar listed there is identical the driver jar name you specified in the build.properties (including the version). Note that, even if you simply uncommented the default MySQL configuration, you will still need to add the right version here.
<resource-root path="mysql-connector-java-5.1.18.jar"/>
步骤四:
修改配置文件 build.properties
F:\jbpm-6.5.0.Final-installer-full\jbpm-installer 下
修改前
# default is H2
H2.version=1.3.168
db.name=h2
db.driver.jar.name=h2-${H2.version}.jar
db.driver.download.url=http://repo1.maven.org/maven2/com/h2database/h2/${H2.version}/h2-${H2.version}.jar#other options are:
#mysql
# db.name=mysql
# db.driver.module.prefix=com/mysql
# db.driver.jar.name=mysql-connector-java-5.1.18.jar #db.driver.download.url=https://repository.jboss.org/nexus/service/local/repositories/central/content/mysql/mysql-connector-java/5.1.18/mysql-connector-java-5.1.18.jar
修改后
# default is H2#H2.version=1.3.168#db.name=h2#db.driver.jar.name=h2-${H2.version}.jar #db.driver.download.url=http://repo1.maven.org/maven2/com/h2database/h2/${H2.version}/h2-${H2.version}.jar
#other options are:
#mysqldb.name=mysqldb.driver.module.prefix=com/mysqldb.driver.jar.name=mysql-connector-java-5.1.18.jar db.driver.download.url=https://repository.jboss.org/nexus/service/local/repositories/central/content/mysql/mysql-connector-java/5.1.18/mysql-connector-java-5.1.18.jar
到此 修改工作结束,接着就是 尝试 ant 命令
如图:
说明 部署成功
到此 修改 数据库 有H2 转成 mysql 成功
欢迎 各位大佬 光临指正 有问题 在线留言