jbpm3.0数据库移植

来源:互联网 发布:风之教堂cad图纸数据 编辑:程序博客网 时间:2024/06/05 20:56

以下以移植到mysql为例,其他数据库类似。

一、从网站(http://www.jboss.org/products/jbpm)上下载jbpm-starters-kit-with-eclipse-3.0.zip,并解压缩

二、把解压缩中jbpm-starters-kit-with-eclipse-3.0/jbpm-server/server的jbpm文件夹拷贝到jboss服务器下(例如拷贝到D:/jboss-4.0.2/server下),这样jbpm服务器就建好了

三、把jbpm-starters-kit-with-eclipse-3.0/jbpm-server下的start.bat,与stop.bat拷贝到jboss服务器下(例如拷贝到D:/jboss-4.0.2/下)这两个文件主要为了启动jbpm服务器用的

四、把jbpm-starters-kit-with-eclipse-3.0/jbpm-designer拷贝出来作为你的开发环境(就是eclipse3.1+jbpm插件)

五、把jbpm-starters-kit-with-eclipse-3.0/jbpm导入到开发环境中

六、在mysql中新建一个数据库(例如jbpmserver)

七、在mysql cc中运行jbpm-starters-kit-with-eclipse-3.0/jbpm-db/build/mysql/scripts中的mysql.create.sql建立表结构

运行如下sql在数据库中增加几个用户

INSERT INTO JBPM_ID_USER VALUES(1,'U','cookie monster','cookie.monster@sesamestreet.tv','crunchcrunch');

INSERT INTO JBPM_ID_USER VALUES(2,'U','ernie','ernie@sesamestreet.tv','canthereyoubert,theresabananainmyear');

INSERT INTO JBPM_ID_USER VALUES(3,'U','bert','bert@sesamestreet.tv','ernie,theresabananainyourear');

INSERT INTO JBPM_ID_USER VALUES(4,'U','grover','grover@sesamestreet.tv','mayday mayday');

 

八、修改jbpm3.0源代码中的hibernate.cfg.xml,主要修改如下:

    <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>

    <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>

    <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/jbpmserver</property>

    <property name="hibernate.connection.username">root</property>

    <property name="hibernate.connection.password">zhgd</property>

       

       

       <!--

    <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>

    <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>

    <property name="hibernate.connection.url">jdbc:hsqldb:.;sql.enforce_strict_size=true</property>

    <property name="hibernate.connection.username">sa</property>

    <property name="hibernate.connection.password"></property>

     -->

 

九、修改jbpm3.0源代码中的jbpm.hibernate.properties修改如下

#hibernate.dialect=org.hibernate.dialect.HSQLDialect

hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect

hibernate.connection.datasource=java:/DefaultDSJBPM

hibernate.query.substitutions=true 1, false 0

#hibernate.c3p0.min_size=1

#hibernate.c3p0.max_size=3

# hibernate.show_sql=true

 

十、在jboss中新建一个mysql数据源DefaultDSJBPM

十一、       修改jboss中的jboss-4.0.2/server/jbpm/deploy/jbpm.sar/META-INF/jboss-service.xml

修改如下

<?xml version="1.0" encoding="UTF-8"?>

 

<server>

  <mbean code="org.jbpm.db.jmx.JbpmService"

         name="jboss.jbpm:name=DefaultJbpm,service=JbpmService"

         description="Default jBPM Service">

    <attribute name="JndiName">java:/jbpm/JbpmSessionFactory</attribute>

    <depends>jboss.jca:service=DataSourceBinding,name=DefaultDSJBPM</depends>

  </mbean>

</server>

十二、把mysql驱动程序拷贝到jboss-4.0.2/server/jbpm/lib中

 

十三、双击start.bat,启动jbpm服务器,在浏览器中输入http://localhost:8080/jbpm,看是否已经修改成功

原创粉丝点击