子在川上曰

            逝者如斯夫不舍晝夜
          隨筆 - 71, 文章 - 0, 評論 - 915, 引用 - 0
          數據加載中……

          jBPM開發入門指南(3)

          5  安裝 jBPM Eclipse 開發插件

          有個輔助工具開發起來方便一點,只不過現在 jBPM 的開發工具插件功能還不算太強,也就一個“項目創建向導”的功能,讓你:

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

          (2)直接得到了一個 jBPM 的項目初始結構

          其實吧,開發 jBPM 也不需要什么插件工具,在熟練了以后,庫引用了項目初始結構都可以手工創建。

          ?

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

          ?

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

          20060823_image001.jpg?

          ?

          6   jBPM Hello World

          6.1 新建jBPM項目

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

          ? 20060823_image002.jpg


          選上好,單擊“下一步”,起個名“
          myjbpm ”,然后就可以單擊“完成”了。然后就生成了如下圖所示的一個項目結構:
          20060823_image003.jpg?

          這個項目和通常
          Eclipse 的項目結構有點不同,不過這是一個現在非常流行的項目結構, src/java 存放源文件, test/java 存放相應的 JUnit 單元測試代碼。如果你用 Maven 來編譯構建項目,對這種目錄結構一定不陌生。

          ?

          項目創建起了,介紹一下里面的文件吧:

          l?????????? MessageActionHandler ,自動生成的一個 ActionHandler 。不想要可以刪掉。

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

          l?????????? hibernate.cfg.xml   jBPM 是用 Hibernate 進行工作流的數據存儲的,這個就是 Hibernate 的配置文件。后面我們將講到如何配置這個文件。

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

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

          l?????????? SimpleProcessTest.java  這個是對最重要的流程配置文件的 processdefinition.xml 單元測試代碼。這里表揚一點, jBPM 的優良設計使得它的可測試性非常之高,喜歡寫 t 單元測試的人有福了。

          l?????????? gpd.xml  用于生成流程圖的定義文件。都是一些方框的坐標和長寬

          l?????????? processdefinition.xml  這個是對最重要的流程配置文件,以后寫流程要經常和它打交道。

          l?????????? processimage.jpg  一個流程圖


          從項目結構來看,我們沒有看到
          JSP 網頁程序,也沒有看到 GUI 客戶端程序,這些代碼都是要我們以后開發中來寫的。但本文不準備用 JSP 、 GUI Swing SWT )來做示例,而是用 JUnit 代碼來做使用 jBPM 客戶端來演示。因為 jBPM 實際上是一個后臺框架,至于前臺是 JSP 還是 Swing 還是無界面的 java.class 都是無關緊要的。在教程里用無界面的 java.class 來做客戶端則更方便一些,如果進一步采用 JUnit ,則這樣的 java.class 同時還具備了單元測試的功能。以后就是用 JSP 寫了 WEB 頁面,我們還是可以用這些 JUnit 程序來做單元測試,避免了頻繁的鼠標點按 WEB 頁面這樣的力氣活。所以在 jBPM 自帶的英文教程里都是一個 JUnit 程序,不仔佃看還真摸不著頭腦。

          ?

          6.2 修改hibernate.cfg.xml

          ?????? hibernate.cfg.xml 的默認設置是用 HSQL ,這是一個內存數據庫,這種內存數據庫用來代替項目實際所用的數據庫來做單元測試挺不錯的。不過我們這里是要試試用 MySQL 、 Oracle ,那就改一下設置吧。

          注:配置值可參考 D:\jbpm-starters-kit-3.1.1\jbpm-db 對應子目錄下的 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 里做了如下的設置

          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 項也可以設為: jdbc:oracle:oci:@WXXRDB_192.168.123.10

          ?

          6.3 完善庫引用

          ?????? 雖然 jBPM 在創建項目之初給我們設置好了庫引用,如下圖

          20060823_image004.jpg
          ?

          但后面運行時還是報一些 NoClassDefFoundError 異常,如沒有對 hibernate3.jar 的引用導致下面的錯誤

          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)

          ??? .......

          ?

          所以我們要為本文的實例完善庫引用。主要是把 MySQL Oracle JDBC 庫、以及 Hibernate hibernate3.jar 加入到項目的庫引用中。

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

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

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

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

          (2)?????? 在項目里創建一個 lib 目錄,將這三個 jar 復制到 lib 目錄。

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

          20060823_image005.jpg?

          ?

          6.4 開始HellorWorld

          這里是一個很簡單的請假流程,請假人提交假單給經理審批,經理審批后結束。要說明的是,這個流程并不嚴謹,比如經理不通過流程應該到哪?不過這并不防礙拿它來做示例,螃蟹還得一個一個的吃。我們先拿這一桿子捅到底的流程做一個最簡單的示例,從整體上對 jBPM 工作流開發有概念先。然后我們再慢慢豐富。

          ?

          1 、定義流程

          流程的定義文件是 processdefinition.xml ,這個是一個關鍵文件, jBPM 的很大一部份內容都是關于它的。在這里我們把原來自動生成的內容,稍做改動:

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

          ?

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

          ??? <!-- 申請 -->

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

          ??????? <task>

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

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

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

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

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

          ??????? </task>

          ??????? <!-- 流程轉向 -->

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

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

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

          ??????????????? <reason> 我要請假 </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>

          ??? <!-- 結束 -->

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

          </process-definition>


          說明:

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

          <controller> 標簽定義了三個數據:姓名、請假天數、說明。

          <transition> 標簽定了 request 節點的一個流程轉向,這里是轉到 confirm 節點。

          <action> 標簽定義了流程由一個節點轉到另一個節點時,所要執行的動作,動作封裝在一個 ActionHandler 類中。比如這里當 request confirm 結點時將執行 RequestAction 類的 execute 方法。

          FinishAction 下面還有一個 <reason> (請假理由),它對應于 FinshAction 的屬性 String reason 。

          ?

          2 、 編寫 ActionHandler

          ?????? 在上面 processdefinition.xml 里我們定義了兩個 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 是一個貫通流程的容器。它是個大寶箱,里面啥玩意都有,后面將更深入的提到。這里的 reasion 就是 processdefinition.xml 中的 我要請假

          ?

          ?

          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", " 準假 " );

          ??? }

          ?

          }

          ?

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

          ?

          6.5 部署processdefinition.xml

          ?????? 我們要把 processdefinition.xml 的流程定義的數據部署到數據庫中,因為 jBPM 在正式運行的時候不是去讀 processdefinition.xml 文件,而是去讀數據庫中的流程定義。 這里寫了一個個 JUnit 程序來部署 processdefinition.xml ,當然你用普通的 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 {

          ??? /**

          ??? ?* 在本方法執行完畢后,檢查 jbpm_processdefinition 表會多了一條記錄

          ??? ? *

          ??? ?* @throws FileNotFoundException

          ??? ? */

          ??? public void testDeployProcessDefinition() throws FileNotFoundException {

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

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

          ??????? // 創建一個 jbpm 容器

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

          ??????? // processdefinition.xml 生成相對應的流程定義類 ProcessDefinition

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

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

          ??????? // 利用容器的方法將流程定義數據部署到數據庫上

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

          ??????? // 關閉 jbpmContext

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

          ??? }

          ?

          }

          ?

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

          ?

          6.6 從數據庫中的查看部署效果

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

          20060823_image006.jpg
          ?

          依次檢查各表我們可以發現有如下變化:

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

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

          jbpm_processdefinition

          一個流程定義文件對應一條記錄,可記錄多個流程定義文件,可記錄一個流程定義文件的對個版本。

          jbpm_action

          記錄 ActionHandler 的對象實例(以名稱為標識)

          jbpm_delegation

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

          jbpm_envent

          它的 transition 引用了 Jbpm_transition 表的 id ,再看其它字段,估計此表是表示流程轉向事件的一個實例,或者是一個各表之間的聯接表。

          jbpm_node

          流程結點

          jbpm_transition

          流程的轉向定義

          jbpm_variableaccess

          流程中攜帶的變量。 ACCESS 字段是這些變量的讀寫權限

          ?

          ?

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

          ?? ?

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

          評論

          # re: jBPM開發入門指南(3)   回復  更多評論   

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

          # re: jBPM開發入門指南(3)   回復  更多評論   

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

          # re: jBPM開發入門指南(3)   回復  更多評論   

          我按照例子一步步配置,運行的時候出現幾個錯誤:
          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">
          還請賜教
          2006-09-05 11:07 | 車轱轆

          # re: jBPM開發入門指南(1)   回復  更多評論   

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

          # re: jBPM開發入門指南(3)   回復  更多評論   

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

          # re: jBPM開發入門指南(3)   回復  更多評論   

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

          # re: jBPM開發入門指南(3)   回復  更多評論   

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

          # re: jBPM開發入門指南(3)   回復  更多評論   

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

          # re: jBPM開發入門指南(3)   回復  更多評論   

          問一個問題,我配置完后進行部署,但是log提示找不到database 'jbpm'
          我用mysql作數據庫,需要手動創建database嗎?還是程序會自動生成數據庫中的相關數據庫和表
          2007-01-16 13:58 | 風人園

          # re: jBPM開發入門指南(3)   回復  更多評論   

          你好:
            我從您給的地址下載后解壓縮得到的包是jbpm-starters-kit-3.1.4
          它和jbpm-starters-kit-3.1.1有什么區別嗎?我把D:\jbpm-starters-kit-3.1.4下的jbpm包也改為jbpm.3,但是我在執行ant mysql.scripts命令時,還會出現那樣的錯誤,并且是三個.這是那里的問題呢?是因為jbpm的版本不同嗎?如果是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開發入門指南(3)   回復  更多評論   

          你好,
          請問這種方式部署到數據庫后,流程所引用到的class并沒有發布到數據庫.
          這個與.par打包方式發布有所區別呢.
          哪種方式比較好呢
          2007-03-14 16:05 | wzy

          # re: jBPM開發入門指南(3)   回復  更多評論   

          發現一個問題,將流程定義發布到數據庫時,在流程中
          <reason> 我要請假 </reason>
          這里的" 我要請假 "前后的空格會自動去掉,在資料庫中是
          <reason xmlns="urn:jbpm.org:jpdl-3.1">我要請假</reason>
          2007-03-14 17:12 | wzy

          # re: jBPM開發入門指南(3)   回復  更多評論   

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

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

          這是 運行 您的代碼出現的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開發入門指南(3) [未登錄]  回復  更多評論   

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

          # re: jBPM開發入門指南(3)   回復  更多評論   

          @ppxiaofei
          應該是數據庫名或者密碼有錯誤
          2007-07-10 15:44 | 小云

          # re: jBPM開發入門指南(3)   回復  更多評論   

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

          # re: jBPM開發入門指南(3)   回復  更多評論   

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

          # re: jBPM開發入門指南(3)   回復  更多評論   

          我按你說的作,出錯了,不知道如何進行,好打擊人啊,看別人都做好了,郁悶。我的信箱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開發入門指南(3)   回復  更多評論   

          您好
          照著您的方式演練時候發生了錯誤
          希望能指點指點
          錯誤代碼如下:
          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開發入門指南(3)   回復  更多評論   

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

          # re: jBPM開發入門指南(3)   回復  更多評論   

          org.hibernate.MappingException: Named query not known: GraphSession.findLatestProcessDefinitionQuery"
          報這個異常,沒法解決
          2008-05-05 15:44 | jbpm初學

          # re: jBPM開發入門指南(3)   回復  更多評論   

          同樣,是這個MySQL報錯:
          痛苦啊。。。。


          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開發入門指南(3)   回復  更多評論   

          急急急?。?!
          照你的做下去出現一下異常:
          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開發入門指南(3)   回復  更多評論   

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

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

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

          # re: jBPM開發入門指南(3)   回復  更多評論   

          select * from jbpm_processdefinition
          出現 Der Typ von Feld 'ISTERMINATIONIMPLICIT_'wird nocht untestttzt 的錯誤提示框
          2008-11-14 16:43 | 天藍色

          # re: jBPM開發入門指南(3)   回復  更多評論   

          我是用的jbpm-starters-kit-3.1.4,導出的項目結構與作者給的不同。
          InputStream is = new FileInputStream("processes/simple/processdefinition.xml");
          這個下的路徑當然要改下。

          還有mysql的異常可能要在eclipse里建立數據庫連接。就是在myecipse database explorer視圖下建立mysql數據庫。
          2008-12-02 10:37 | hoho

          # re: jBPM開發入門指南(3)   回復  更多評論   

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

          # re: jBPM開發入門指南(3)   回復  更多評論   

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

          # re: jBPM開發入門指南(3)   回復  更多評論   

          MYSQL運行通過謝謝,剛學對這個不理解。
          2009-05-04 15:28 | 李榮

          # re: jBPM開發入門指南(3)   回復  更多評論   

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

          # re: jBPM開發入門指南(3)   回復  更多評論   


          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開發入門指南(3)   回復  更多評論   

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

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

          你好,我運行junit的時候說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

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

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

          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)

          這是什么錯誤?原先是有些jar包沒加入,后來加了ehcache-1[1].5.0.jar就出現以上的錯誤
          2009-10-12 18:48 | black
          主站蜘蛛池模板: 长子县| 衡南县| 西乌珠穆沁旗| 饶平县| 徐闻县| 临朐县| 贞丰县| 青浦区| 类乌齐县| 安庆市| 商河县| 商洛市| 长丰县| 宜春市| 肃宁县| 军事| 临西县| 诏安县| 花莲市| 新竹县| 历史| 巴塘县| 黎平县| 高青县| 塘沽区| 石阡县| 武平县| 玉门市| 固始县| 马公市| 曲沃县| 南涧| 平武县| 托克托县| 西盟| 长沙市| 水富县| 中卫市| 柏乡县| 肃宁县| 南宫市|