子在川上曰

            逝者如斯夫不舍晝夜
          隨筆 - 71, 文章 - 0, 評(píng)論 - 915, 引用 - 0
          數(shù)據(jù)加載中……

          jBPM開發(fā)入門指南(3)

          5  安裝 jBPM Eclipse 開發(fā)插件

          有個(gè)輔助工具開發(fā)起來方便一點(diǎn),只不過現(xiàn)在 jBPM 的開發(fā)工具插件功能還不算太強(qiáng),也就一個(gè)“項(xiàng)目創(chuàng)建向?qū)А钡墓δ埽屇悖?/span>

          (1)不用再去配置 classpath 庫(kù)的引用了

          (2)直接得到了一個(gè) jBPM 的項(xiàng)目初始結(jié)構(gòu)

          其實(shí)吧,開發(fā) jBPM 也不需要什么插件工具,在熟練了以后,庫(kù)引用了項(xiàng)目初始結(jié)構(gòu)都可以手工創(chuàng)建。

          ?

          插件不用再去下載了, jbpm-starters-kit-3.1.1 包里就有,目錄地址如下: D:\jbpm-starters-kit-3.1.1\jbpm-designer\jbpm-gpd-feature\eclipse ,插件的安裝方式是鏈接式還是直接復(fù)制式,任選吧。不懂的就去看看《 Eclipse 從入門精通》這本書,在前面章節(jié)都有講到。另外,注明一下 Eclipse 的版本我是用 3.2 ,插件和 Eclispe 版本相關(guān)的,要注意了。

          ?

          如果安裝成功,則 Eclipse 首選項(xiàng)里多了一個(gè) JBoss jBPM ,另外我們也需要到這個(gè) jBPM 的首選項(xiàng)里做一些配置工作――指定 jBPM 的安裝路徑(如下圖所示)。這個(gè)配置主要是為了找到 jbpm 下的各種 jar 包,好讓 Eclipse 設(shè)置項(xiàng)目的庫(kù)引用。本文指向路徑是 d:\jbpm-starters-kit-3.1.1\jbpm.3

          20060823_image001.jpg?

          ?

          6   jBPM Hello World

          6.1 新建jBPM項(xiàng)目

          主菜單“文件->新建->項(xiàng)目”,在彈出的對(duì)話框里,有“ Process Project ”項(xiàng),如下圖所示:

          ? 20060823_image002.jpg


          選上好,單擊“下一步”,起個(gè)名“
          myjbpm ”,然后就可以單擊“完成”了。然后就生成了如下圖所示的一個(gè)項(xiàng)目結(jié)構(gòu):
          20060823_image003.jpg?

          這個(gè)項(xiàng)目和通常
          Eclipse 的項(xiàng)目結(jié)構(gòu)有點(diǎn)不同,不過這是一個(gè)現(xiàn)在非常流行的項(xiàng)目結(jié)構(gòu), src/java 存放源文件, test/java 存放相應(yīng)的 JUnit 單元測(cè)試代碼。如果你用 Maven 來編譯構(gòu)建項(xiàng)目,對(duì)這種目錄結(jié)構(gòu)一定不陌生。

          ?

          項(xiàng)目創(chuàng)建起了,介紹一下里面的文件吧:

          l?????????? MessageActionHandler ,自動(dòng)生成的一個(gè) ActionHandler 。不想要可以刪掉。

          l?????????? ehcache.xml? cache 的配置文件,里面有很詳解的英文說明。沒有必要可以不用改它。

          l?????????? hibernate.cfg.xml   jBPM 是用 Hibernate 進(jìn)行工作流的數(shù)據(jù)存儲(chǔ)的,這個(gè)就是 Hibernate 的配置文件。后面我們將講到如何配置這個(gè)文件。

          l?????????? jbpm.cfg.xml   jbpm 本身的配置文件?,F(xiàn)在是空的,它用的是缺省配置,你想知道有哪些配置就去看這個(gè)文件 D:\jbpm-starters-kit-3.1.1\jbpm.3\src\java.jbpm\org\jbpm\default.jbpm.cfg.xml

          l?????????? log4j.properties  這個(gè)是日志 API log4j 的配置文件,用過 log4j 的都知道。

          l?????????? SimpleProcessTest.java  這個(gè)是對(duì)最重要的流程配置文件的 processdefinition.xml 單元測(cè)試代碼。這里表?yè)P(yáng)一點(diǎn), jBPM 的優(yōu)良設(shè)計(jì)使得它的可測(cè)試性非常之高,喜歡寫 t 單元測(cè)試的人有福了。

          l?????????? gpd.xml  用于生成流程圖的定義文件。都是一些方框的坐標(biāo)和長(zhǎng)寬

          l?????????? processdefinition.xml  這個(gè)是對(duì)最重要的流程配置文件,以后寫流程要經(jīng)常和它打交道。

          l?????????? processimage.jpg  一個(gè)流程圖


          從項(xiàng)目結(jié)構(gòu)來看,我們沒有看到
          JSP 網(wǎng)頁(yè)程序,也沒有看到 GUI 客戶端程序,這些代碼都是要我們以后開發(fā)中來寫的。但本文不準(zhǔn)備用 JSP 、 GUI Swing 、 SWT )來做示例,而是用 JUnit 代碼來做使用 jBPM 客戶端來演示。因?yàn)?/span> jBPM 實(shí)際上是一個(gè)后臺(tái)框架,至于前臺(tái)是 JSP 還是 Swing 還是無界面的 java.class 都是無關(guān)緊要的。在教程里用無界面的 java.class 來做客戶端則更方便一些,如果進(jìn)一步采用 JUnit ,則這樣的 java.class 同時(shí)還具備了單元測(cè)試的功能。以后就是用 JSP 寫了 WEB 頁(yè)面,我們還是可以用這些 JUnit 程序來做單元測(cè)試,避免了頻繁的鼠標(biāo)點(diǎn)按 WEB 頁(yè)面這樣的力氣活。所以在 jBPM 自帶的英文教程里都是一個(gè) JUnit 程序,不仔佃看還真摸不著頭腦。

          ?

          6.2 修改hibernate.cfg.xml

          ?????? hibernate.cfg.xml 的默認(rèn)設(shè)置是用 HSQL ,這是一個(gè)內(nèi)存數(shù)據(jù)庫(kù),這種內(nèi)存數(shù)據(jù)庫(kù)用來代替項(xiàng)目實(shí)際所用的數(shù)據(jù)庫(kù)來做單元測(cè)試挺不錯(cuò)的。不過我們這里是要試試用 MySQL 、 Oracle ,那就改一下設(shè)置吧。

          注:配置值可參考 D:\jbpm-starters-kit-3.1.1\jbpm-db 對(duì)應(yīng)子目錄下的 hibernate.properties 文件。

          1 、 MySQL 的更改如下:

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

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

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

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

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

          ?

          2 Oracle 的更改如下:

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

          <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>

          <property name="hibernate.connection.url">jdbc:oracle:thin:@192.168.123.10:1521:wxxrDB</property>

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

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

          ?

          如果你裝了 Oracle 的客戶端,并且 D:\oracle\ora92\network\ADMIN\tnsnames.ora 里做了如下的設(shè)置

          WXXRDB_192.168.123.10 =

          ? (DESCRIPTION =

          ??? (ADDRESS_LIST =

          ????? (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.123.10)(PORT = 1521))

          ??? )

          ??? (CONNECT_DATA =

          ????? (SID = wxxrDB)

          ????? (SERVER = DEDICATED)

          ??? )

          ? )


          Oracle hibernate.connection.url 項(xiàng)也可以設(shè)為: jdbc:oracle:oci:@WXXRDB_192.168.123.10

          ?

          6.3 完善庫(kù)引用

          ?????? 雖然 jBPM 在創(chuàng)建項(xiàng)目之初給我們?cè)O(shè)置好了庫(kù)引用,如下圖

          20060823_image004.jpg
          ?

          但后面運(yùn)行時(shí)還是報(bào)一些 NoClassDefFoundError 異常,如沒有對(duì) hibernate3.jar 的引用導(dǎo)致下面的錯(cuò)誤

          java.lang.NoClassDefFoundError: org/hibernate/Session

          ??? at org.jbpm.persistence.db.DbPersistenceServiceFactory.openService(DbPersistenceServiceFactory.java:55)

          ??? at org.jbpm.svc.Services.getService(Services.java:136)

          ??? .......

          ?

          所以我們要為本文的實(shí)例完善庫(kù)引用。主要是把 MySQL Oracle JDBC 庫(kù)、以及 Hibernate hibernate3.jar 加入到項(xiàng)目的庫(kù)引用中。

          (1)?????? 找到缺少的 jar

          l?????????? mysql jdbc 包,在 D:\jbpm-starters-kit-3.1.1\jbpm-db\mysql\lib 目錄里

          l?????????? oracle jdbc 包, jbmp 中沒有包含(可能是沒拿到 oracle 授權(quán)),我們可以自已去 oracle 網(wǎng)站上下載,或者去 oracle 安裝目錄 D:\oracle\ora92\jdbc\lib ojdbc14.jar (我們公司用的是 Oracle9i

          l?????????? Hibernate3.jar 在目錄 D:\jbpm-starters-kit-3.1.1\jbpm.3\lib\hibernate 里。

          (2)?????? 在項(xiàng)目里創(chuàng)建一個(gè) lib 目錄,將這三個(gè) jar 復(fù)制到 lib 目錄。

          (3)?????? 如下圖設(shè)置三 jar 包的庫(kù)引用

          20060823_image005.jpg?

          ?

          6.4 開始HellorWorld

          這里是一個(gè)很簡(jiǎn)單的請(qǐng)假流程,請(qǐng)假人提交假單給經(jīng)理審批,經(jīng)理審批后結(jié)束。要說明的是,這個(gè)流程并不嚴(yán)謹(jǐn),比如經(jīng)理不通過流程應(yīng)該到哪?不過這并不防礙拿它來做示例,螃蟹還得一個(gè)一個(gè)的吃。我們先拿這一桿子捅到底的流程做一個(gè)最簡(jiǎn)單的示例,從整體上對(duì) jBPM 工作流開發(fā)有概念先。然后我們?cè)俾S富。

          ?

          1 、定義流程

          流程的定義文件是 processdefinition.xml ,這個(gè)是一個(gè)關(guān)鍵文件, jBPM 的很大一部份內(nèi)容都是關(guān)于它的。在這里我們把原來自動(dòng)生成的內(nèi)容,稍做改動(dòng):

          <?xml version="1.0" encoding="GBK"?>

          ?

          <process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="helloworld">

          ??? <!-- 申請(qǐng) -->

          ??? <start-state name="request">

          ??????? <task>

          ??????????? <controller>

          ??????????????? <variable name="name" />

          ??????????????? <variable name="day" />

          ??????????????? <variable name="note" />

          ??????????? </controller>

          ??????? </task>

          ??????? <!-- 流程轉(zhuǎn)向 -->

          ??????? <transition name="to_confirm" to="confirm">

          ??????????? <action name="requestAction"

          ??????????????? class ="cn.com.chengang.jbpm.RequestAction">

          ??????????????? <reason> 我要請(qǐng)假 </reason>

          ??? ??????? </action>

          ??????? </transition>

          ??? </start-state>

          ??? <!-- 審批 -->

          ??? <state name="confirm">

          ??????? <transition name="to_end" to="end">

          ??????????? <action name="finishAction"

          ??????????????? class ="cn.com.chengang.jbpm.ConfirmAction" />

          ??????? </transition>

          ??? </state>

          ??? <!-- 結(jié)束 -->

          ??? <end-state name="end" />

          </process-definition>


          說明:

          流程的名稱改成了 helloworld 。(呵呵,也就是這里和 helloworld 有關(guān)了)

          <controller> 標(biāo)簽定義了三個(gè)數(shù)據(jù):姓名、請(qǐng)假天數(shù)、說明。

          <transition> 標(biāo)簽定了 request 節(jié)點(diǎn)的一個(gè)流程轉(zhuǎn)向,這里是轉(zhuǎn)到 confirm 節(jié)點(diǎn)。

          <action> 標(biāo)簽定義了流程由一個(gè)節(jié)點(diǎn)轉(zhuǎn)到另一個(gè)節(jié)點(diǎn)時(shí),所要執(zhí)行的動(dòng)作,動(dòng)作封裝在一個(gè) ActionHandler 類中。比如這里當(dāng) request confirm 結(jié)點(diǎn)時(shí)將執(zhí)行 RequestAction 類的 execute 方法。

          FinishAction 下面還有一個(gè) <reason> (請(qǐng)假理由),它對(duì)應(yīng)于 FinshAction 的屬性 String reason

          ?

          2 、 編寫 ActionHandler

          ?????? 在上面 processdefinition.xml 里我們定義了兩個(gè) ActionHandler RequestAction 、 ConfirmAction 。其代碼如下:

          package cn.com.chengang.jbpm;

          ?

          import org.jbpm.graph.def.ActionHandler;

          import org.jbpm.graph.exe.ExecutionContext;

          ?

          public class RequestAction implements ActionHandler {

          ?

          ??? private static final long serialVersionUID = 1L;

          ?

          ??? private String reason;

          ?

          ??? public String getReason() {

          ??????? return reason;

          ??? }

          ?

          ??? public void setReason(String reason) {

          ??????? this .reason = reason;

          ??? }

          ?

          ??? public void execute(ExecutionContext context) throws Exception {

          ??????? context.getContextInstance().setVariable("note", reason);

          ??? }

          ?

          }

          ?

          說明: ExecutionContext 是一個(gè)貫通流程的容器。它是個(gè)大寶箱,里面啥玩意都有,后面將更深入的提到。這里的 reasion 就是 processdefinition.xml 中的 我要請(qǐng)假

          ?

          ?

          package cn.com.chengang.jbpm;

          ?

          import org.jbpm.graph.def.ActionHandler;

          import org.jbpm.graph.exe.ExecutionContext;

          ?

          public class ConfirmAction implements ActionHandler {

          ?

          ??? private static final long serialVersionUID = 1L;

          ?

          ??? public void execute(ExecutionContext context) throws Exception {

          ??????? context.getContextInstance().setVariable("note", " 準(zhǔn)假 " );

          ??? }

          ?

          }

          ?

          OK ,后臺(tái)的程序就算寫完了(前臺(tái)客戶端的程序還沒寫),下面開始部署。

          ?

          6.5 部署processdefinition.xml

          ?????? 我們要把 processdefinition.xml 的流程定義的數(shù)據(jù)部署到數(shù)據(jù)庫(kù)中,因?yàn)?/span> jBPM 在正式運(yùn)行的時(shí)候不是去讀 processdefinition.xml 文件,而是去讀數(shù)據(jù)庫(kù)中的流程定義。 這里寫了一個(gè)個(gè) JUnit 程序來部署 processdefinition.xml ,當(dāng)然你用普通的 Java Main 也可以。

          package com.sample;

          ?

          import java.io.FileInputStream;

          import java.io.FileNotFoundException;

          import java.io.InputStream;

          ?

          import junit.framework.TestCase;

          ?

          import org.jbpm.JbpmConfiguration;

          import org.jbpm.JbpmContext;

          import org.jbpm.graph.def.ProcessDefinition;

          ?

          /**

          ?* 部署 processdefinition.xml

          ? *

          ?* @author chengang

          ? *

          ? */

          public class DeployProcessTest extends TestCase {

          ??? /**

          ??? ?* 在本方法執(zhí)行完畢后,檢查 jbpm_processdefinition 表會(huì)多了一條記錄

          ??? ? *

          ??? ?* @throws FileNotFoundException

          ??? ? */

          ??? public void testDeployProcessDefinition() throws FileNotFoundException {

          ??????? // jbpm.cfg.xml 取得 jbpm 的配置

          ??????? JbpmConfiguration config = JbpmConfiguration.getInstance();

          ??????? // 創(chuàng)建一個(gè) jbpm 容器

          ??????? JbpmContext jbpmContext = config.createJbpmContext();

          ??????? // processdefinition.xml 生成相對(duì)應(yīng)的流程定義類 ProcessDefinition

          ??????? InputStream is = new FileInputStream("processes/simple/processdefinition.xml");

          ??????? ProcessDefinition processDefinition = ProcessDefinition.parseXmlInputStream(is);

          ??????? // 利用容器的方法將流程定義數(shù)據(jù)部署到數(shù)據(jù)庫(kù)上

          ??????? jbpmContext.deployProcessDefinition(processDefinition);

          ??????? // 關(guān)閉 jbpmContext

          ??????? jbpmContext.close();

          ??? }

          ?

          }

          ?

          運(yùn)行此程序,在控制臺(tái)打印了一些日志,通過。如果出錯(cuò),仔佃閱讀出錯(cuò)信息以判斷錯(cuò)誤原因,并確定你按照前面兩節(jié):“修改 hibernate.cfg.xml ”和“完善庫(kù)引用”的內(nèi)容做好了設(shè)置。

          ?

          6.6 從數(shù)據(jù)庫(kù)中的查看部署效果

          無論是 MySQL 還是 Oracle ,查詢 jbpm_processdefinition 表,你會(huì)發(fā)現(xiàn)多了一條記錄,如下圖 ( PLSQL Developer 的顯示為例 )

          20060823_image006.jpg
          ?

          依次檢查各表我們可以發(fā)現(xiàn)有如下變化:

          20060823_image007.jpg
          20060823_image008.jpg
          20060823_image009.jpg
          20060823_image010.jpg
          20060823_image011.jpg
          20060823_image012.jpg
          ?

          并由此簡(jiǎn)單判斷出各表的作用,表中各字段的作用由字段名也能知曉一二。

          jbpm_processdefinition

          一個(gè)流程定義文件對(duì)應(yīng)一條記錄,可記錄多個(gè)流程定義文件,可記錄一個(gè)流程定義文件的對(duì)個(gè)版本。

          jbpm_action

          記錄 ActionHandler 的對(duì)象實(shí)例(以名稱為標(biāo)識(shí))

          jbpm_delegation

          記錄了 ActionHandler 全類名,以便于用反射方式來加載

          jbpm_envent

          它的 transition 引用了 Jbpm_transition 表的 id ,再看其它字段,估計(jì)此表是表示流程轉(zhuǎn)向事件的一個(gè)實(shí)例,或者是一個(gè)各表之間的聯(lián)接表。

          jbpm_node

          流程結(jié)點(diǎn)

          jbpm_transition

          流程的轉(zhuǎn)向定義

          jbpm_variableaccess

          流程中攜帶的變量。 ACCESS 字段是這些變量的讀寫權(quán)限

          ?

          ?

          ?作者簡(jiǎn)介
          陳剛,廣西桂林人,著作有《Eclipse從入門到精通》
          您可以通過其博客了解更多信息和文章:
          http://www.ChenGang.com.cn
          ?
          ?

          ?? ?

          posted on 2006-08-23 19:26 陳剛 閱讀(45504) 評(píng)論(36)  編輯  收藏 所屬分類: jBPM

          評(píng)論

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          你好,
          能請(qǐng)教一個(gè)問題嗎?
          我按照你的例子能夠把它部署到ECLIPSE的測(cè)試環(huán)境中,但是我用那個(gè)Test就出現(xiàn)了如下的問題不知為什么?
          "org.hibernate.MappingException: Named query not known: GraphSession.findLatestProcessDefinitionQuery"
          還有一個(gè)問題就是,如果我用ECLIPSE的jbpm的工具生成了processdefinition.xml(業(yè)務(wù)流程),那么我怎樣才能使用它呢?我怎樣和業(yè)務(wù)數(shù)據(jù),用戶,權(quán)限結(jié)合在一起呢?
          謝謝!
          2006-08-29 14:27 | Rami

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          @Rami
          你的第一個(gè)問題,我判斷不出原因。org.hibernate.MappingException也許是數(shù)據(jù)庫(kù)的問題
          第二問題,jbpm的工具生成了processdefinition.xml和手寫的processdefinition.xml是一樣的,文章中已經(jīng)給出了使用方法了呀。
          2006-09-01 09:25 | 陳剛

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          我按照例子一步步配置,運(yùn)行的時(shí)候出現(xiàn)幾個(gè)錯(cuò)誤:
          1 NodeTypes : node 'page' will not be available. class 'org.jboss.seam.pageflow.Page' couldn't be loaded
          2 WARN JpdlXmlReader : process xml warning: warning: no swimlane or assignment specified for task '<task xmlns="urn:jbpm.org:jpdl-3.1" blocking="false" signalling="true" priority="normal">
          還請(qǐng)賜教
          2006-09-05 11:07 | 車轱轆

          # re: jBPM開發(fā)入門指南(1)   回復(fù)  更多評(píng)論   

          我按照你的re: jBPM開發(fā)入門指南(1) 中的步驟做了但是就是出不來界面
          2006-09-12 13:26 | 小東

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          按照你的例子作了一下,感覺好像醍醐灌頂,很多疑問都解決了!多謝了!
          我開始學(xué)java的時(shí)候就買了你的eclipse入門到精通。希望你以后多發(fā)些jbpm的好文。
          2006-09-15 10:13 | jeffen2006

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          我用eclipse 插件定義了一個(gè)流程,并且hibernate的配置文件改為oracle了,但用插件部署之后,我的數(shù)據(jù)庫(kù)中并沒有增加一條記錄,部署提示成功。
          2006-09-15 14:06 | goushijie

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          你好,請(qǐng)教一個(gè)問題,可以嗎?
          我在執(zhí)行DeployProcessTest時(shí)出錯(cuò),提示cannot open connection。
          已經(jīng)在項(xiàng)目屬性的庫(kù)引用中將oracle14.jar和hibernate3.jar包設(shè)置,并且路徑設(shè)在項(xiàng)目根目錄下的lib文件夾中。
          而且修改了\bin文件夾下的hibernate.config.xml文件中的數(shù)據(jù)庫(kù)連接設(shè)置。
          我不清楚連接不上還有可能哪里出問題?謝謝
          2006-09-18 16:27 | ppxiaofei

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          我提交完“我要請(qǐng)假”后,出現(xiàn)在mysql里的卻是亂碼,然后它就告訴我說找不到“我要請(qǐng)假”,請(qǐng)問這個(gè)怎么解決
          2006-12-18 10:37 | 小林[匿名]

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          問一個(gè)問題,我配置完后進(jìn)行部署,但是log提示找不到database 'jbpm'
          我用mysql作數(shù)據(jù)庫(kù),需要手動(dòng)創(chuàng)建database嗎?還是程序會(huì)自動(dòng)生成數(shù)據(jù)庫(kù)中的相關(guān)數(shù)據(jù)庫(kù)和表
          2007-01-16 13:58 | 風(fēng)人園

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          你好:
            我從您給的地址下載后解壓縮得到的包是jbpm-starters-kit-3.1.4
          它和jbpm-starters-kit-3.1.1有什么區(qū)別嗎?我把D:\jbpm-starters-kit-3.1.4下的jbpm包也改為jbpm.3,但是我在執(zhí)行ant mysql.scripts命令時(shí),還會(huì)出現(xiàn)那樣的錯(cuò)誤,并且是三個(gè).這是那里的問題呢?是因?yàn)閖bpm的版本不同嗎?如果是3.1.4版本怎么改呢?謝謝?。?!

          D:\jbpm-starters-kit-3.1.4\jbpm-db>ant mysql.scripts
          Buildfile: build.xml

          mysql.scripts:

          prepare:

          compile.jbpm:

          compile.identity:

          compile.jbpm.test:
          [javac] Compiling 65 source files to D:\jbpm-starters-kit-3.1.4\jbpm.3\build
          \classes.jbpm.test
          [javac] D:\jbpm-starters-kit-3.1.4\jbpm.3\src\java.jbpm.test\org\jbpm\msg\co
          mmand\AsyncExecutionDbTest.java:143: cannot resolve symbol
          [javac] symbol : method getStackTrace ()
          [javac] location: class org.jbpm.msg.command.CommandExecutorThread
          [javac] commandExecutor.getStackTrace();
          [javac] ^
          [javac] D:\jbpm-starters-kit-3.1.4\jbpm.3\src\java.jbpm.test\org\jbpm\msg\co
          mmand\AsyncExecutionDbTest.java:144: cannot resolve symbol
          [javac] symbol : method getState ()
          [javac] location: class org.jbpm.msg.command.CommandExecutorThread
          [javac] log.debug("command executor state: "+commandExecutor.getStat
          e());
          [javac] ^
          [javac] D:\jbpm-starters-kit-3.1.4\jbpm.3\src\java.jbpm.test\org\jbpm\msg\co
          mmand\AsyncExecutionDbTest.java:146: cannot resolve symbol
          [javac] symbol : method getStackTrace ()
          [javac] location: class org.jbpm.msg.command.CommandExecutorThread
          [javac] StackTraceElement[] commandExecutorStackTrace = commandExecu
          tor.getStackTrace();
          [javac]
          ^
          [javac] 3 errors

          BUILD FAILED
          D:\jbpm-starters-kit-3.1.4\jbpm-db\build.xml:361: The following error occurred w
          hile executing this line:
          D:\jbpm-starters-kit-3.1.4\jbpm-db\build.xml:68: The following error occurred wh
          ile executing this line:
          D:\jbpm-starters-kit-3.1.4\jbpm.3\build.xml:58: Compile failed; see the compiler
          error output for details.

          Total time: 21 seconds
          D:\jbpm-starters-kit-3.1.4\jbpm-db>
          2007-03-02 10:01 | liyanhui

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          你好,
          請(qǐng)問這種方式部署到數(shù)據(jù)庫(kù)后,流程所引用到的class并沒有發(fā)布到數(shù)據(jù)庫(kù).
          這個(gè)與.par打包方式發(fā)布有所區(qū)別呢.
          哪種方式比較好呢
          2007-03-14 16:05 | wzy

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          發(fā)現(xiàn)一個(gè)問題,將流程定義發(fā)布到數(shù)據(jù)庫(kù)時(shí),在流程中
          <reason> 我要請(qǐng)假 </reason>
          這里的" 我要請(qǐng)假 "前后的空格會(huì)自動(dòng)去掉,在資料庫(kù)中是
          <reason xmlns="urn:jbpm.org:jpdl-3.1">我要請(qǐng)假</reason>
          2007-03-14 17:12 | wzy

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          成功了,呵呵
          2007-04-23 17:32 | yollywu

          # re: jBPM開發(fā)入門指南(3) [未登錄]  回復(fù)  更多評(píng)論   

          這是 運(yùn)行 您的代碼出現(xiàn)的bug
          Hibernate:
          /* named HQL query GraphSession.findLatestProcessDefinitionQuery */ select
          processdef0_.ID_ as ID1_4_,
          processdef0_.NAME_ as NAME2_4_,
          processdef0_.VERSION_ as VERSION3_4_,
          processdef0_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_,
          processdef0_.STARTSTATE_ as STARTSTATE5_4_
          from
          JBPM_PROCESSDEFINITION processdef0_
          where
          processdef0_.NAME_=?
          order by
          processdef0_.VERSION_ desc limit ?
          10:40:35,390 [main] WARN JDBCExceptionReporter : SQL Error: 1064, SQLState: 42000
          10:40:35,390 [main] ERROR JDBCExceptionReporter : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1
          org.hibernate.exception.SQLGrammarException: could not execute query
          at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65)
          at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
          at org.hibernate.loader.Loader.doList(Loader.java:2153)
          at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
          at org.hibernate.loader.Loader.list(Loader.java:2024)
          at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:369)
          at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:300)
          at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:146)
          at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1093)
          at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
          at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:745)
          at org.jbpm.db.GraphSession.findLatestProcessDefinition(GraphSession.java:153)
          at org.jbpm.db.GraphSession.deployProcessDefinition(GraphSession.java:67)
          at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:173)
          at com.businessFlow.DeployProcessTest.testDeployProcessDefinition(DeployProcessTest.java:31)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at junit.framework.TestCase.runTest(TestCase.java:154)
          at junit.framework.TestCase.runBare(TestCase.java:127)
          at junit.framework.TestResult$1.protect(TestResult.java:106)
          at junit.framework.TestResult.runProtected(TestResult.java:124)
          at junit.framework.TestResult.run(TestResult.java:109)
          at junit.framework.TestCase.run(TestCase.java:118)
          at junit.framework.TestSuite.runTest(TestSuite.java:208)
          at junit.framework.TestSuite.run(TestSuite.java:203)
          at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
          at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
          Caused by: java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1
          at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2851)
          at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1534)
          at com.mysql.jdbc.ServerPreparedStatement.serverPrepare(ServerPreparedStatement.java:1485)
          at com.mysql.jdbc.ServerPreparedStatement.<init>(ServerPreparedStatement.java:151)
          at com.mysql.jdbc.Connection.prepareStatement(Connection.java:1309)
          at com.mysql.jdbc.Connection.prepareStatement(Connection.java:1281)
          at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:442)
          at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:368)
          at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:105)
          at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561)
          at org.hibernate.loader.Loader.doQuery(Loader.java:661)
          at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
          at org.hibernate.loader.Loader.doList(Loader.java:2150)
          ... 30 more
          10:40:35,593 [main] ERROR GraphSession : org.hibernate.exception.SQLGrammarException: could not execute query
          2007-05-18 10:46 | yxw

          # re: jBPM開發(fā)入門指南(3) [未登錄]  回復(fù)  更多評(píng)論   

          用HSQL就沒有問題;用mysql就有上面的問題
          2007-05-18 11:35 | yxw

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          @ppxiaofei
          應(yīng)該是數(shù)據(jù)庫(kù)名或者密碼有錯(cuò)誤
          2007-07-10 15:44 | 小云

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          我用的jbpm-starters-kit-3.1.4和myeclipse5.5,現(xiàn)在還沒發(fā)現(xiàn)有什么沖突。
          2007-08-16 10:04 | Gone with the Wind

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          謝謝??!
          非常感謝??!
          除了這些我還想說?。?
          非常非常感謝??!
          受益了!!
          謝謝陳同志??!
          2007-09-04 11:27 | liumingrui

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          我按你說的作,出錯(cuò)了,不知道如何進(jìn)行,好打擊人啊,看別人都做好了,郁悶。我的信箱livingbody@gmail.com,有消息給我說下。
          3:30:17,781 [main] DEBUG DbPersistenceService : creating hibernate session
          13:30:17,843 [main] DEBUG DbPersistenceService : beginning hibernate transaction
          13:30:17,859 [main] DEBUG DbPersistenceService : begun hibernate transaction org.hibernate.transaction.JDBCTransaction@14323d5
          13:30:17,937 [main] WARN JDBCExceptionReporter : SQL Error: 1054, SQLState: 42S22
          13:30:17,937 [main] ERROR JDBCExceptionReporter : Unknown column 'processdef0_.DESCRIPTION_' in 'field list'
          org.hibernate.exception.SQLGrammarException: could not execute query
          at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
          at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
          at org.hibernate.loader.Loader.doList(Loader.java:2223)
          at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
          at org.hibernate.loader.Loader.list(Loader.java:2099)
          at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
          at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
          at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
          at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
          at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
          at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:811)
          at org.jbpm.db.GraphSession.findLatestProcessDefinition(GraphSession.java:153)
          at org.jbpm.db.GraphSession.deployProcessDefinition(GraphSession.java:67)
          at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:173)
          at com.sample.DeployProcessTest.testDeployProcessDefinition(DeployProcessTest.java:63)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at junit.framework.TestCase.runTest(TestCase.java:154)
          at junit.framework.TestCase.runBare(TestCase.java:127)
          at junit.framework.TestResult$1.protect(TestResult.java:106)
          at junit.framework.TestResult.runProtected(TestResult.java:124)
          at junit.framework.TestResult.run(TestResult.java:109)
          at junit.framework.TestCase.run(TestCase.java:118)
          at junit.framework.TestSuite.runTest(TestSuite.java:208)
          at junit.framework.TestSuite.run(TestSuite.java:203)
          at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
          at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
          Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown column 'processdef0_.DESCRIPTION_' in 'field list'
          at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
          at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
          at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
          at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
          at com.mysql.jdbc.Connection.execSQL(Connection.java:3176)
          at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1153)
          at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1266)
          at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
          at org.hibernate.loader.Loader.getResultSet(Loader.java:1787)
          at org.hibernate.loader.Loader.doQuery(Loader.java:674)
          at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
          at org.hibernate.loader.Loader.doList(Loader.java:2220)
          ... 30 more
          13:30:18,140 [main] ERROR GraphSession : org.hibernate.exception.SQLGrammarException: could not execute query
          2007-10-24 13:31 | livingbody

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          您好
          照著您的方式演練時(shí)候發(fā)生了錯(cuò)誤
          希望能指點(diǎn)指點(diǎn)
          錯(cuò)誤代碼如下:
          18:02:32,867 [main] ERROR JDBCExceptionReporter : Table not found in statement [select top ? processdef0_.ID_ as ID1_4_, processdef0_.NAME_ as NAME2_4_, processdef0_.VERSION_ as VERSION3_4_, processdef0_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_, processdef0_.STARTSTATE_ as STARTSTATE5_4_ from JBPM_PROCESSDEFINITION processdef0_ where processdef0_.NAME_=? order by processdef0_.VERSION_ desc]
          org.hibernate.exception.SQLGrammarException: could not execute query
          at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65)
          at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
          at org.hibernate.loader.Loader.doList(Loader.java:2153)
          at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
          at org.hibernate.loader.Loader.list(Loader.java:2024)
          at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:369)
          at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:300)
          at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:146)
          at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1093)
          at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
          at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:745)
          at org.jbpm.db.GraphSession.findLatestProcessDefinition(GraphSession.java:153)
          at org.jbpm.db.GraphSession.deployProcessDefinition(GraphSession.java:67)
          at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:173)
          at com.sample.DeployProcessTest.testDeployProcessDefinition(DeployProcessTest.java:38)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at junit.framework.TestCase.runTest(TestCase.java:154)
          at junit.framework.TestCase.runBare(TestCase.java:127)
          at junit.framework.TestResult$1.protect(TestResult.java:106)
          at junit.framework.TestResult.runProtected(TestResult.java:124)
          at junit.framework.TestResult.run(TestResult.java:109)
          at junit.framework.TestCase.run(TestCase.java:118)
          at junit.framework.TestSuite.runTest(TestSuite.java:208)
          at junit.framework.TestSuite.run(TestSuite.java:203)
          at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
          at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
          Caused by: java.sql.SQLException: Table not found in statement [select top ? processdef0_.ID_ as ID1_4_, processdef0_.NAME_ as NAME2_4_, processdef0_.VERSION_ as VERSION3_4_, processdef0_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_, processdef0_.STARTSTATE_ as STARTSTATE5_4_ from JBPM_PROCESSDEFINITION processdef0_ where processdef0_.NAME_=? order by processdef0_.VERSION_ desc]
          at org.hsqldb.jdbc.Util.throwError(Unknown Source)
          at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source)
          at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
          at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:442)
          at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:368)
          at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:105)
          at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561)
          at org.hibernate.loader.Loader.doQuery(Loader.java:661)
          at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
          at org.hibernate.loader.Loader.doList(Loader.java:2150)
          ... 30 more
          18:05:24,634 [main] ERROR GraphSession : org.hibernate.exception.SQLGrammarException: could not execute query


          還望您給予教誨~
          急啊
          2007-11-12 18:14 | kidhu

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          @車轱轆
          我也是這個(gè)問題,也在找答案
          2008-01-18 11:00 | hw

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          org.hibernate.MappingException: Named query not known: GraphSession.findLatestProcessDefinitionQuery"
          報(bào)這個(gè)異常,沒法解決
          2008-05-05 15:44 | jbpm初學(xué)

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          同樣,是這個(gè)MySQL報(bào)錯(cuò):
          痛苦啊。。。。


          16:23:30,078 [main] DEBUG NullableType : binding 'helloworld' to parameter: 1
          16:23:30,078 [main] WARN JDBCExceptionReporter : SQL Error: 1054, SQLState: 42S22
          16:23:30,078 [main] ERROR JDBCExceptionReporter : Unknown column 'processdef0_.DESCRIPTION_' in 'field list'
          16:23:30,078 [main] ERROR GraphSession : org.hibernate.exception.SQLGrammarException: could not execute query
          2008-07-27 00:30 | Dones

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          急急急?。。?
          照你的做下去出現(xiàn)一下異常:
          1、org.hibernate.HibernateException: Could not instantiate cache implementation

          2、Caused by: org.hibernate.cache.NoCachingEnabledException: Second-level cache is not enabled for usage [hibernate.cache.use_second_level_cache | hibernate.cache.use_query_cache]

          能給說一下是怎么回事呢
          2008-08-21 20:22 | 22

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          多謝,最近在項(xiàng)目中剛好用到工作流,所以找了些資料研究,按照你的方法配成功了,多謝,希望以后能出好文章,支持:)
          2008-09-08 21:19 | zkx

          # re: jBPM開發(fā)入門指南(3) [未登錄]  回復(fù)  更多評(píng)論   

          樓主的文章很好啊,我照著例子做一路順暢。再次感謝樓主了
          2008-09-23 11:23 | 小鳥

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          select * from jbpm_processdefinition
          出現(xiàn) Der Typ von Feld 'ISTERMINATIONIMPLICIT_'wird nocht untestttzt 的錯(cuò)誤提示框
          2008-11-14 16:43 | 天藍(lán)色

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          我是用的jbpm-starters-kit-3.1.4,導(dǎo)出的項(xiàng)目結(jié)構(gòu)與作者給的不同。
          InputStream is = new FileInputStream("processes/simple/processdefinition.xml");
          這個(gè)下的路徑當(dāng)然要改下。

          還有mysql的異??赡芤趀clipse里建立數(shù)據(jù)庫(kù)連接。就是在myecipse database explorer視圖下建立mysql數(shù)據(jù)庫(kù)。
          2008-12-02 10:37 | hoho

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          @22
          <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
          加到hibernate配置中
          2008-12-09 18:39 | hexh2003

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          我想請(qǐng)問下,能不能自定義流程配置文件,我說的不是直接編輯xml而是希望在前臺(tái)能自己定義配置文件
          初步想法是通過dom4j來做xml的讀寫,生成新的配置文件,就是不知道,是不是要重新部署才能持久化到數(shù)據(jù)庫(kù)中去,如果那樣的話感覺好像就不能在前臺(tái)由客戶自定義了,請(qǐng)指教!!
          2008-12-26 15:48 | johnyong

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          MYSQL運(yùn)行通過謝謝,剛學(xué)對(duì)這個(gè)不理解。
          2009-05-04 15:28 | 李榮

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          @ppxiaofei 出現(xiàn)你說說的問題最大的可能性是jar包未被應(yīng)用,單單在工程文件里建一個(gè)lib包不夠,還要將jar包應(yīng)用,具體做法是在java build path選項(xiàng)里面有個(gè)add jars選項(xiàng),你要將ojdbc14.jar引用一下。
          2009-05-11 15:44 | annymous

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   


          org.hibernate.exception.GenericJDBCException: could not insert: [org.jbpm.graph.def.ProcessDefinition]
          at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
          at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
          at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
          at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:64)
          at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2186)
          at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2666)
          at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
          at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
          at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:321)
          at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:204)
          at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:130)
          at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
          at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:56)
          at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
          at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:50)
          at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
          at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:562)
          at org.hibernate.impl.SessionImpl.save(SessionImpl.java:550)
          at org.hibernate.impl.SessionImpl.save(SessionImpl.java:546)
          at org.jbpm.db.GraphSession.deployProcessDefinition(GraphSession.java:77)
          at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:173)
          at com.rov.sample.DeployProcessTest.testDeployProcessDefinition(DeployProcessTest.java:19)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at junit.framework.TestCase.runTest(TestCase.java:154)
          at junit.framework.TestCase.runBare(TestCase.java:127)
          at junit.framework.TestResult$1.protect(TestResult.java:106)
          at junit.framework.TestResult.runProtected(TestResult.java:124)
          at junit.framework.TestResult.run(TestResult.java:109)
          at junit.framework.TestCase.run(TestCase.java:118)
          at junit.framework.TestSuite.runTest(TestSuite.java:208)
          at junit.framework.TestSuite.run(TestSuite.java:203)
          at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
          at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
          Caused by: java.sql.SQLException: Field 'CLASS_' doesn't have a default value
          at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2975)
          at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1600)
          at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1129)
          at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:681)
          at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1368)
          at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1283)
          at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1268)
          at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:94)
          at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)
          ... 36 more

          2009-05-28 11:56 | rov

          # re: jBPM開發(fā)入門指南(3)   回復(fù)  更多評(píng)論   

          非常感謝..
          2009-08-27 16:06 | bike

          # re: jBPM開發(fā)入門指南(3) [未登錄]  回復(fù)  更多評(píng)論   

          你好,我運(yùn)行junit的時(shí)候說org.jbpm.JbpmException: couldn't find process definition 'HelloWorld'
          at org.jbpm.db.GraphSession.findLatestProcessDefinition(GraphSession.java:170)
          at org.jbpm.db.GraphSession.deployProcessDefinition(GraphSession.java:67)
          at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:173)
          at com.sample.DeployProcessTest.testDeployProcessDefinition(DeployProcessTest.java:42)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at junit.framework.TestCase.runTest(TestCase.java:154)
          at junit.framework.TestCase.runBare(TestCase.java:127)
          at junit.framework.TestResult$1.protect(TestResult.java:106)
          at junit.framework.TestResult.runProtected(TestResult.java:124)
          at junit.framework.TestResult.run(TestResult.java:109)
          at junit.framework.TestCase.run(TestCase.java:118)
          at junit.framework.TestSuite.runTest(TestSuite.java:208)
          at junit.framework.TestSuite.run(TestSuite.java:203)
          at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
          at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
          Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
          at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:65)
          at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
          at org.hibernate.loader.Loader.doList(Loader.java:2153)
          at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
          at org.hibernate.loader.Loader.list(Loader.java:2024)
          at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:369)
          at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:300)
          at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:146)
          at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1093)
          at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
          at org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:745)
          at org.jbpm.db.GraphSession.findLatestProcessDefinition(GraphSession.java:153)
          ... 21 more
          Caused by: java.sql.SQLException: Table not found in statement [select top ? processdef0_.ID_ as ID1_4_, processdef0_.NAME_ as NAME2_4_, processdef0_.VERSION_ as VERSION3_4_, processdef0_.ISTERMINATIONIMPLICIT_ as ISTERMIN4_4_, processdef0_.STARTSTATE_ as STARTSTATE5_4_ from JBPM_PROCESSDEFINITION processdef0_ where processdef0_.NAME_=? order by processdef0_.VERSION_ desc]
          at org.hsqldb.jdbc.Util.throwError(Unknown Source)
          at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source)
          at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
          at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:442)
          at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:368)
          at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:105)
          at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561)
          at org.hibernate.loader.Loader.doQuery(Loader.java:661)
          at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
          at org.hibernate.loader.Loader.doList(Loader.java:2150)
          ... 30 more

          這是什么原因?我都是一步一步按照這個(gè)來的
          2009-10-12 15:40 | black

          # re: jBPM開發(fā)入門指南(3) [未登錄]  回復(fù)  更多評(píng)論   

          java.lang.NoClassDefFoundError: edu/emory/mathcs/backport/java/util/concurrent/BlockingQueue
          at net.sf.ehcache.config.ConfigurationHelper.createCache(ConfigurationHelper.java:418)
          at net.sf.ehcache.config.ConfigurationHelper.createDefaultCache(ConfigurationHelper.java:334)
          at net.sf.ehcache.CacheManager.configure(CacheManager.java:306)
          at net.sf.ehcache.CacheManager.init(CacheManager.java:226)
          at net.sf.ehcache.CacheManager.<init>(CacheManager.java:213)
          at net.sf.ehcache.CacheManager.create(CacheManager.java:394)
          at org.hibernate.cache.EhCacheProvider.start(EhCacheProvider.java:130)
          at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:172)
          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1154)
          at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:90)
          at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:74)
          at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:78)
          at org.jbpm.persistence.db.DbPersistenceService.getGraphSession(DbPersistenceService.java:227)
          at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:537)
          at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:173)
          at com.sample.DeployProcessTest.testDeployProcessDefinition(DeployProcessTest.java:42)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at junit.framework.TestCase.runTest(TestCase.java:154)
          at junit.framework.TestCase.runBare(TestCase.java:127)
          at junit.framework.TestResult$1.protect(TestResult.java:106)
          at junit.framework.TestResult.runProtected(TestResult.java:124)
          at junit.framework.TestResult.run(TestResult.java:109)
          at junit.framework.TestCase.run(TestCase.java:118)
          at junit.framework.TestSuite.runTest(TestSuite.java:208)
          at junit.framework.TestSuite.run(TestSuite.java:203)
          at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
          at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
          at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

          這是什么錯(cuò)誤?原先是有些jar包沒加入,后來加了ehcache-1[1].5.0.jar就出現(xiàn)以上的錯(cuò)誤
          2009-10-12 18:48 | black

          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 砚山县| 敖汉旗| 郯城县| 涿鹿县| 大埔区| 南川市| 肇源县| 红原县| 油尖旺区| 方正县| 大名县| 上虞市| 武汉市| 北海市| 富平县| 金沙县| 古交市| 阜宁县| 灌云县| 桐城市| 土默特右旗| 云安县| 泗水县| 伊春市| 万山特区| 玛多县| 佛山市| 枝江市| 平罗县| 太康县| 鄂尔多斯市| 格尔木市| 萨迦县| 宁津县| 屏山县| 江城| 即墨市| 汕头市| 喜德县| 班戈县| 台南县|