Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of converting Activiti5.9 into MySQL Database

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the example analysis of changing Activiti5.9 into MySQL database, the content is very detailed, interested friends can refer to it, I hope it can be helpful to you.

The default database of Activiti5.9 is db, but mysql is used in our project, so we have to replace db with mysql

Steps:

1. Download activiti-5.9.zip

two。 Extract activiti-5.10.zip and move (ACTIVITI_HOME=D:\ myspace\ activiti-5.9)

3. Modify the ACTIVITI_HOME\ setup\ build.db.properties file to use the MySQL configuration, as shown in this example:

# MySQL Config

Db=mysql

Jdbc.driver=com.mysql.jdbc.Driver

Jdbc.url=jdbc:mysql://localhost:3306/activiti?autoReconnect=true

Jdbc.username=root

Jdbc.password=1234

4. Copy the MySQL driver to ACTIVITI_HOME\ setup\ files\ dependencies\ libs (mysql-connector-java-5.1.15-bin.jar)

5. Modify the ACTIVITI_HOME\ setup\ build.xml file to add the driver path for MySQL

Original content:

After modification:

6. Initialize the MySQL database contents:

Start the MySQL database server and create the database activiti.

(if there is a subsequent ant demo.start, initialize the database: ant internal.db.create, no need to execute).

7. Rename the file ACTIVITI_HOME\ setup\ files\ demo\ h3.data.sql to setup\ files\ demo\ mysql.data.sql

8. Change h3-1.3.168.jar to mysql-connector-java-5.1.9-bin.jar in the following files

ACTIVITI_HOME\ setup\ files\ dependencies\ libs.engine.test.txt

ACTIVITI_HOME\ setup\ files\ dependencies\ libs.webapp.explorer.txt

ACTIVITI_HOME\ setup\ files\ dependencies\ libs.webapp.rest.txt

ACTIVITI_HOME\ setup\ files\ dependencies\ libs.engine.runtime.feature.cxf.txt

9. Delete servlet-api-2.5.jar in ACTIVITI_HOME\ setup\ files\ dependencies\ libs.engine.runtime.feature.cxf.txt

Delete ACTIVITI_HOME\ setup\ files\ dependencies\ libs\ h3-1.3.168.jar, servlet-api-2.5.jar

10. Delete the operation code of the h3 database in the ACTIVITI_HOME\ setup\ build.xml file

Depends in target:demo.start deletes h3.start

Delete in target:demo.install

Depends in target:demo.stop deletes h3.stop

Note: you can also modify

For a browser on your computer, you can use the default browser you set up without modification.

11. In order to avoid affecting the operation due to the network download, download apache-tomcat-6.0.32.zip and put it under ACTIVITI_HOME\\ downloads\.

Modify the downloads.dir=../downloads in ACTIVITI_HOME\ setup\ build.properties

12.cmdWhile-> cd ACTIVITI_HOME\ setup > ant demo.start

Error occurred: no suitable driver found for jdbc:mysql://localhost:3306/activiti

Solution: copy the database-driven mysql-connector-java-5.1.15-bin.jar to JAVA_HOME\ jre\ lib\ ext

Note that if something goes wrong:

Please delete the ACTIVITI_HOME\ apps directory, delete the ACTIVITI_HOME\ setup\ build directory, and then in ant demo.start

Please delete the database drop database activiti first

Rebuild create database activiti again

Tomcat console Chinese garbled code:

At ACTIVITI_HOME\ apps\ apache-tomcat-6.0.32\ conf\ logging.properties

ACTIVITI_HOME\ apps\ apache-tomcat-6.0.32\ webapps\ activiti-explorer\ WEB-INF\ classes\ logging.properties

ACTIVITI_HOME\ apps\ apache-tomcat-6.0.32\ webapps\ activiti-rest\ WEB-INF\ classes\ logging.properties

Add one line of code to three files: java.util.logging.ConsoleHandler.encoding=GBK

/ * /

Untested conjecture: add a sentence to the ACTIVITI_HOME\ setup\ files\ tomcat\ logging.properties file before building the operation

Java.util.logging.ConsoleHandler.encoding=GBK, is it possible to avoid the problem of Chinese garbled in tomcat?

The conjecture about the result of this conjecture is that the problem of Chinese garbled can only be partially solved, but not when an example is started.

The conjecture was proved to be correct after testing. You must manually add code to the WEB-INF\ classes\ logging.properties file in the example

Java.util.logging.ConsoleHandler.encoding=GBK can solve all the problems of Chinese garbled code.

13. After successful construction: http://localhost:8080/activiti-explorer, you can visit activiti

Three test users:

Administrator: kermit kermit

Manager: gonzo gonzo

User: fozzie fozzie

This is the end of the sample analysis on the conversion of Activiti5.9 to MySQL database. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report