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

Migration and deployment process of jbpm on tomcat and mysql

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article mainly explains "the migration and deployment process of jbpm on tomcat and mysql". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the migration and deployment process of jbpm on tomcat and mysql".

JBPM, whose full name is Java Business Process Management, is a lightweight workflow management system based on J2EE. JBPM is an open source project that follows Apache License. JBPM released version 2.0 on October 18, 2004, and joined JBoss on the same day as a part of the JBoss enterprise middleware platform, and its name was changed to JBoss jBPM.

JBPM has two major features that make it one or two major points in the market. One of the biggest features is that its business logic definition does not adopt some current specifications, such as WfMC's.

XPDL, BPML, ebXML, BPEL4WS, etc., but its own definition of JBoss jBPM Process definition

Language

(jPdl). JPdl regards a business logic process as a UML state diagram. If you are not familiar with UML state diagrams, you should be familiar with the flow chart of the beginner computer language.

It's the same thing. JPdl defines each part of the state diagram in detail, such as start and end states, transitions between states, etc. Another major feature is the integration of Hibernate, specifically binding, using the

Hibernate manages the database so that jBPM only focuses on his business process control.

As can be seen from the above, jBPM is a business process management engine and a workflow engine. In addition, it implements both jPDL and BPEL support. It integrates

The Hibernate technology deals with the database, creates a series of database tables, and persists the state required by the workflow engine. Therefore, jBPM supports all databases supported by Hibernate and can

It is enough to persist Java objects to the database and save the objects of Java classes supported by Hibernate to the database!

You can use JBoss jBPM just like you can use Java's class library, and you can configure JBoss jBPM to be deployed on other J2EE application servers and any database.

In this article, let's first create our JBoss jBPM runtime development environment. Before you begin, please prepare the software product:

JDK 1.5 or later, where JDK 6u10b is used

Apache Tomcat 5.5.x or later, where Tomcat 6.0.16 is used

MySQL 5.1. you can also choose other databases supported by Hiberante. There is not much difference. MySQL 5.1is used here.

Apache Ant 1.7.0

JBPM-3.2.3

Eclipse Europa (Eclipse V3.3) for JavaEE Developers or higher, Eclipse V3.4 is used here

Description: a set of service environment has been configured in the release package of JBoss jBPM, which is based on JBoss. Because we are used to the small and flexible nature of Tomcat, and we don't want jBPM to rely on JBoss.

1. Download and install JDK,Tomcat, Ant, MySQL, and set the corresponding environment variables

This step will not be discussed again. Please refer to the official documentation for details.

Jdk: http://java.sun.com/

Ant: http://ant.apache.org/

Tomcat: http://tomcat.apache.org/

Eclipse: http://www.eclipse.org/

two。 Download JBoss jBPM

JBoss jBPM official (http://www.jboss.org/jbossjbpm/) currently released version 3.2.3, only need to download jPDL Suite, download to get jbpm-jpdl-suite-3.2.3.zip, this suite contains all the content and resources, including eclipse plug-ins, samples, and process management control applications.

Decompress jbpm-jpdl-suite-3.2.3.zip. Here, you get D:/jbpm-jpdl-3.2.3 after decompression. The main directory structure is as follows:

D:/jbpm-jpdl-3.2.3

|-db here are all sql definitions and data files. If you switch to other databases, you can use these resources to create them. The service is still very considerate. By the way

| in a nutshell, jBPM defaults to the in-memory database hsqldb, which has not been studied (hehe -)

| |

| |-deploy packages and resources used to deploy your application |

| |

|-designer here is the Eclipse plug-in, so you can define your business process in the graphical interface, and the ashes can live without him.

| |

| |-doc here is the API document of jBPM-related components |

| |

|-examples here are some learning examples

| |

| |-lib jBPM class library |

| |

| |-server there is a JBoss server that includes this JBoss jBPM engine, and a websale example is deployed |

| |

| |-src here is the source code of JBoss jBPM |

3. Configuration database

JBPM needs to store initialization data and workflow definitions in a database, and it defines a set of data structures to store these data, which is also a characteristic of the container itself.

Create a database jbpm, (create database jbpm;) in mysql, and create the user jbossjbpm (password: jbossjbpm)

Note: if you find it troublesome, you can use your root account and its password, but please change the following settings accordingly

Find jbpm.jpdl.mysql.sql in D:/jbpm-jpdl-3.2.3/db

The file must be modified to conform to the grammatical structure of MySQL. Specifically, add a semicolon at the end of each statement ";" you can use UltrEdit

Tools such as EditPlus to do these things (pay attention to matching case when replacing, fields with write tables contain CREATE characters), if this is the first time to create these database tables, delete them

The alter and drop above the create statement (none of these tables exist yet).

4. Prepare the jBPM package

This is a jbpm-jpdl process management console, just as Tomcat has a separate Administrator application for managing configuration and deployment. With him, you can manipulate and control your application in the graphical interface.

Open the command line console, change to the D:/jbpm-jpdl-3.2.3/deploy directory, and execute the following command:

Ant customize.console.for.tomcat

Note: please make sure that your ant installation is properly configured. You can type: ant-version on the command line to check that ant is installed correctly. After the command is executed, you can see the version information of ant, namely OK.

After the ant customize.console.for.tomcat executes successfully, the customized and target directories are generated under the D:/jbpm-jpdl-3.2.3/deploy directory, where the jbpm-console.war under the customized directory is the war package we want.

We need to modify the jbpm-console.war/WEB-INF/classes/hibernate.cfg.xml file to suit our resource properties. The modified results are as follows:

Xml code

Org.hibernate.dialect.MySQLInnoDBDialect

Com.mysql.jdbc.Driver

Jdbc:mysql://localhost:3306/jbpm

Jbossjbpm

Jbossjbpm

Org.hibernate.cache.HashtableCacheProvider

Org.hibernate.dialect.MySQLInnoDBDialect com.mysql.jdbc.Driver jdbc:mysql://localhost:3306/jbpm jbossjbpm jbossjbpm org.hibernate.cache.HashtableCacheProvider org.hibernate.transaction.JDBCTransactionFactory...

Here it is enabled to change the default data property, JDBC connection properties, as well as the self-defined data name and account, and it is important to note that you use the

Xml code

Org.hibernate.transaction.JDBCTransactionFactory

Org.hibernate.transaction.JDBCTransactionFactory

Instead of JTATransactionFactory and CMTTransactionFactory, you can configure it with JTATransactionFactory or CMTTransactionFactory if you want, but it hasn't been studied yet. Friends who know it can learn it together.

Copy the jboss-j2ee.jar package to jbpm-console.war/WEB-INF/lib

. D:/jbpm-jpdl-3.2.3 you can look for this package in many places, such as

D:/jbpm-jpdl-3.2.3/server/client .

Java Transaction Architecture is mainly used here, so you can replace jboss-j2ee.jar with the jta.jar package in J2EE. For more information about jta, please refer to http://java.sun.com/javaee/technologies/jta/index.jsp.

Copy commons-collections.jar package to jbpm-console.war/WEB-INF/lib

. D:/jbpm-jpdl-3.2.3 has this package in several places, such as

D:/jbpm-jpdl-3.2.3/server/server/jbpm/lib . This bag is an Apache Commons bag. You can find it everywhere.

Copy the jsf-api.jar and jsf-impl.jar packages to jbpm-console.war/WEB-INF/lib, and you can use the JBPM-

Jpdl-3.2.3/server/server/jbpm/deploy/jboss-web.deployer/jsf-libs found these two bags.

Description: because jbpm-console is a jsf application, without these two packages, you will report a 404or 505error when you visit.

Copy the MySQL JDBC driver package to% CATALINA_HOME%/lib (Tomcat 6) or% CATALINA_HOME%/common/lib (Tomcat 5.5)

Copy modified jbpm-console to% CATALINA_HOME%/webapps

So the jBPM is basically configured, but we can't access it yet, and we need to configure security access control and initial user data.

5. Configure Tomcat security domain

Method 1: create a jbpm-console.xml file in% CATALINA_HOME%/conf/Catalina/localhost, with the following contents:

Xml code

Method 2: modify the% CATALINA_HOME%/conf/tomcat-users.xml file to set the security domain. In order not to conflict with the existing users of tomcat, the previous login account username= "admin" of tomcat is changed to username= "tadmin". The modified file is as follows:

Xml code

6. Initialization data

Insert the following data into the MySQL jbpm database

Sql code

INSERT INTO JBPM_ID_GROUP VALUES (1 null for Grain, salesmen, salesmen, organizationalists)

INSERT INTO JBPM_ID_GROUP VALUES (2) securitycopyright rolewriting null)

INSERT INTO JBPM_ID_GROUP VALUES (3 null for Gaming, username, security, copyright, rolewriting, and null)

INSERT INTO JBPM_ID_GROUP VALUES (4) null for Grace, for Grace, for hr, for organization, for organization, and null)

INSERT INTO JBPM_ID_GROUP VALUES (5 recordings, playbooks, playbooks, managerstores, securitisation, copyright, rolewriting, null)

INSERT INTO JBPM_ID_USER VALUES (1 referenced user name, sample.domaincircle, user, user, etc.)

INSERT INTO JBPM_ID_USER VALUES (2)

INSERT INTO JBPM_ID_USER VALUES (3)

INSERT INTO JBPM_ID_USER VALUES (4)

INSERT INTO JBPM_ID_MEMBERSHIP VALUES (1) Null Magne2 and 4)

INSERT INTO JBPM_ID_MEMBERSHIP VALUES (2 recordings Manners, nulls, nulls, pencils, 3 pencils, 4)

INSERT INTO JBPM_ID_MEMBERSHIP VALUES (3 recordings, 4 page4)

INSERT INTO JBPM_ID_MEMBERSHIP VALUES (4 recordings Manners, nulls, nulls, 4 pencils, 3)

INSERT INTO JBPM_ID_MEMBERSHIP VALUES (5 recordings Manners recounting null pencils null pencils 1 pencils 3)

INSERT INTO JBPM_ID_MEMBERSHIP VALUES (6 recordings Manners, nulls, nulls, 2 page3)

INSERT INTO JBPM_ID_MEMBERSHIP VALUES (7 recordings, 3 pencils, 3 packs)

INSERT INTO JBPM_ID_MEMBERSHIP VALUES (8 recordings, 3 pencils, 2)

INSERT INTO JBPM_ID_MEMBERSHIP VALUES (9 recordings, 2 pencils, 2 pencils)

INSERT INTO JBPM_ID_MEMBERSHIP VALUES (10 recordings Mill recorder null recordsNull Magi 2 5)

INSERT INTO JBPM_ID_MEMBERSHIP VALUES (11 recordings, masks, nulls, bossbooks, page2, 1)

INSERT INTO JBPM_ID_MEMBERSHIP VALUES (12 recordings, nulls, 1, and 1)

INSERT INTO JBPM_ID_GROUP VALUES (1 null); INSERT INTO JBPM_ID_GROUP VALUES (2); INSERT INTO JBPM_ID_GROUP VALUES (3); INSERT INTO JBPM_ID_GROUP VALUES (3); INSERT INTO JBPM_ID_GROUP VALUES (4). INSERT INTO JBPM_ID_GROUP VALUES (5); INSERT INTO JBPM_ID_USER VALUES (1); INSERT INTO JBPM_ID_USER VALUES (2); INSERT INTO JBPM_ID_USER VALUES (2); INSERT INTO JBPM_ID_USER VALUES (3). INSERT INTO JBPM_ID_USER VALUES (4); INSERT INTO JBPM_ID_MEMBERSHIP VALUES (1); INSERT INTO JBPM_ID_MEMBERSHIP VALUES (2); INSERT INTO JBPM_ID_MEMBERSHIP VALUES (2); INSERT INTO JBPM_ID_MEMBERSHIP VALUES (3); INSERT INTO JBPM_ID_MEMBERSHIP VALUES (4); INSERT INTO JBPM_ID_MEMBERSHIP VALUES (4). INSERT INTO JBPM_ID_MEMBERSHIP VALUES (5); INSERT INTO JBPM_ID_MEMBERSHIP VALUES (6); INSERT INTO JBPM_ID_MEMBERSHIP VALUES (7); INSERT INTO JBPM_ID_MEMBERSHIP VALUES (8); INSERT INTO JBPM_ID_MEMBERSHIP VALUES (9); INSERT INTO JBPM_ID_MEMBERSHIP VALUES (2); INSERT INTO JBPM_ID_MEMBERSHIP VALUES (10). INSERT INTO JBPM_ID_MEMBERSHIP VALUES (11); INSERT INTO JBPM_ID_MEMBERSHIP VALUES (12).

7. Starting the Tomcat service, viewing the console log, troubleshooting errors, database errors, and incomplete support libraries can all cause errors.

Enter: http://localhost:8080/jbpm can be accessed normally in the browser to indicate that the deployment is successful. You can log in and experience it with the users and accounts listed on the page.

Thank you for reading, the above is the content of "jbpm migration and deployment process on tomcat and mysql". After the study of this article, I believe you have a deeper understanding of the migration and deployment process of jbpm on tomcat and mysql, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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

Database

Wechat

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

12
Report