JWorld@TW the best professional Java site in Taiwan
      註冊 | 登入 | 全文檢索 | 排行榜  

» JWorld@TW » Application Server » Tomcat  

按列印兼容模式列印這個話題 列印話題    把這個話題寄給朋友 寄給朋友   
reply to topicthreaded modego to previous topicgo to next topic
己加入精華區
by im1000 at 2005-12-04 23:33
本主題所含的標籤
無標籤
作者 Tomcat+MySQL+jBPM 安裝說明 [精華]
randycch





發文: 47
積分: 3
於 2005-12-03 22:33 user profilesend a private message to usersend email to randycchreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
1. 使用軟體

Tomcat v5.5
MySQL v4.0.24
jBPM v3.0.2

2. 將 database 改成使用 MySQL

2-1. 解壓縮 jbpm-3.0.2.zip , 在 jbpm-3.0.2\lib 下 , 建立目錄 mysql
2-2. copy mssql 的 jdbc driver 至 jbpm-3.0.2\lib\mysql 中
2-3. 在 MySQL 上新增一個 database 名稱為 jbpm
2-4. 在 jbpm-3.0.2\src\resources 下 , 建立目錄 mysql , 並複製 hsqldb 中的檔案
2-5. 修改 jbpm-3.0.2\src\resources\mysql\create.db.hibernate.properties 檔 , 如下 :
1
2
3
4
5
6
7
8
hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.url=jdbc:mysql://localhost/jbpm?useUnicode=true&characterEncoding=utf-8
hibernate.connection.username=sa
hibernate.connection.password=sa
hibernate.c3p0.min_size=1
hibernate.c3p0.max_size=3
hibernate.show_sql=true

2-6. 修改 jbpm-3.0.2\build.deploy.xml 檔 , target 為 create.db 的內容 , 如下 :
1
2
3
4
5
6
7
8
<target name="create.db" depends="declare.jbpm.tasks" description="Create a MySQL Database with the jbpm tables"> 
  <jbpmschema actions="create" properties="${basedir}/src/resources/mysql/create.db.hibernate.properties"/> 
  <loadidentities file="${basedir}/src/resources/mysql/identity.db.xml" properties="${basedir}/src/resources/mysql/create.db.hibernate.properties"/> 
  <ant antfile="build.xml" target="build.processes" inheritall="false" /> 
  <deploypar properties="${basedir}/src/resources/mysql/create.db.hibernate.properties"> 
    <fileset dir="build" includes="*.par" /> 
  </deploypar> 
</target>

2-7. 執行 Ant Build Target 'create.db' , 產生 table schema 至 MySQL
1
ant create.db -buildfile build.deploy.xml 



3. 建立 jbpm.war 並部署至 Tomcat 中

3-1. 因為 Hibernate 不能將它的SessionFactory 與 Tomcat 的 JNDI bind , 所以必須修改 jbpm-3.0.2\src\java.jbpm\org\jbpm\db\JbpmSessionFactory.java 中的 getInstance()
1
2
3
4
5
6
7
public static JbpmSessionFactory getInstance() { 
    if (instance==null) {       
        log.debug("building singleton JbpmSessionFactory"); 
        instance = buildJbpmSessionFactory(); 
    } 
    return instance; 
} 

3-2. 修改 jbpm-3.0.2\src\resources\jbpm.sar\jbpm.hibernate.properties 檔(同2-5) , 如下 :
1
2
3
4
5
6
7
8
hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.url=jdbc:mysql://localhost/jbpm?useUnicode=true&characterEncoding=utf-8
hibernate.connection.username=sa
hibernate.connection.password=sa
hibernate.c3p0.min_size=1
hibernate.c3p0.max_size=3
hibernate.show_sql=true

3-3. 修改 jbpm-3.0.2\src\resources\jbpm.sar\jbpm.properties 檔
1
2
將 jbpm.session.factory.jndi.name=java:/jbpm/JbpmSessionFactory 標記起來 , 如下 : 
# jbpm.session.factory.jndi.name=java:/jbpm/JbpmSessionFactory 

3-4. 執行 Ant Build Target 'build' , 重新 compiler & package
1
ant build -buildfile build.xml 

3-5. 修改 jbpm-3.0.2\build.deploy.xml 檔 , target 為 build.webapp 的內容 , 有一些相關的 library 必需要一起 package 起來 , 如下 :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  <target name="build.webapp" description="builds jbpm.war">
    <ant antfile="build.xml" target="build.webapp" /> 
    <mkdir dir="build/jbpm.war.dir" /> 
    <copy todir="build/jbpm.war.dir">
      <fileset dir="src/resources/jbpm.war" /> 
    </copy> 
    <copy todir="build/jbpm.war.dir/WEB-INF/lib">
      <fileset dir="build" includes="jbpm*.jar" /> 
      <fileset dir="lib/dom4j" includes="*.jar" />
      <fileset dir="lib/jsf" includes="*.jar" />
      <fileset dir="lib/jaxen" includes="*.jar" />
      <fileset dir="lib/commons" includes="commons-digester-*.jar, commons-beanutils-*.jar" />
      <fileset dir="lib/mysql" includes="*.jar" />
      <fileset dir="lib/hibernate" includes="*.jar" />
      <fileset dir="lib/jboss" includes="antlr*.jar, asm*.jar, bsh*.jar, cglib*.jar, commons-*.jar, hibernate*.jar" />
    </copy> 
    <jar destfile="build/jbpm.war">
      <fileset dir="build/jbpm.war.dir" />
    </jar> 
  </target>

3-6. 執行 Ant Build Target 'build.webapp' , 產生 jbpm.war
1
ant build.webapp -buildfile build.deploy.xml 

3-7. 部署 jbpm.war 至你的 Tomcat 的 webapp 目錄下 , 並重新啟動 Tomcat .
3-8. 測試 http://localhost:8080/jbpm


reply to postreply to post
作者 Re:JBoss+MySQL+jBPM 安裝說明 [Re:randycch]
jamieweb





發文: 93
積分: 0
於 2005-12-27 16:53 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
1.把 jbpm 並部署至 Jboss-4.0.3,步驟3-1和3-2有什麼要改變的嗎?
2.如果想讓"jbpm.session.factory.jndi.name=java:/jbpm/JbpmSessionFactory"這行有Jboss有效,怎麼設定呢?


reply to postreply to post
作者 Re:Tomcat+MySQL+jBPM 安裝說明 [Re:randycch]
randycch





發文: 47
積分: 3
於 2006-01-01 10:36 user profilesend a private message to usersend email to randycchreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
1. 若你是使用JBoss 的話 , 3-1和3-3是不需要修改的 , 原本 jBPM 就是使用SessionFactory 的方式來 bind datasource.

reply to postreply to post
作者 Re:Tomcat+MySQL+jBPM 安裝說明 [Re:randycch]
YuLimin

简单就是美

版主

發文: 134
積分: 0
於 2006-03-28 16:16 user profilesend a private message to userreply to postreply to postsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
http://labs.jboss.com/portal/jbossjbpm/download/index.html

我怎么只看到
JBoss jBPM 3.0.1
JBoss jBPM Starters Kit 3.0.1
JBoss jBPM Process Designer Plugin 3.0.4
JBoss jBPM BPEL Extension 1.0 alpha 3

不过,我还是在这里找到了:)
http://prdownloads.sourceforge.net/jbpm/?sort_by=date&sort=desc


reply to postreply to post
 当兵不后悔!后悔不当兵! 
超越黎明时空,追逐时代潮流!
人,是要靠自己的!简单就是美!
我的Java:http://www.Java2Class.net
我的Blog:http://YuLimin.JavaEye.com
» JWorld@TW »  Application Server » Tomcat

reply to topicthreaded modego to previous topicgo to next topic
  已讀文章
  新的文章
  被刪除的文章
Jump to the top of page

JWorld@TW 本站商標資訊

Powered by Powerful JuteForum® Version Jute 1.5.8