jbpm 錯誤解決方案

來源:互聯網
上載者:User

1.執行流程出現如下錯誤:

org.jbpm.pvm.internal.type.variable.UnpersistableVariable

出現錯誤的原因:

變數沒有實現  Serializable 介面

解決辦法:

變數需要實現   Serializable 介面。

 

2.java.lang.ClassCastException: $Proxy53 cannot be cast to oracle.sql.BLOB

出現錯誤原因:

我使用的是Hibernate 3.6版本。

解決辦法:

在網上查到解決辦法 使用 hibernate3.5.4替換3.6.

 

3.項目啟動第一次訪問,發布流程沒問題。但是第二次啟動項目,再發布一個新流程的時候報如下錯誤.

2010-10-14 19:51:58,234 ERROR [org.hibernate.util.JDBCExceptionReporter] - 流已被關閉

org.hibernate.exception.GenericJDBCException: could not initialize a collection: [org.jbpm.pvm.internal.repository.DeploymentImpl.resources#1]
出現錯誤的原因是:

hibernate自動建立資料庫時,設定檔中某些欄位被hibernate解析成long類型。

在產生表後手動將LONG類型修改為字串類型。

 

4.在發布流程的時候 使用addResourceFromString方法發布流程,資源名稱應該是 以 .jpdl.xml 結尾的。

如果不是發布會不成功。

 

5.流程定義檔案讀取亂碼的問題。

使用PL/SQL直接在資料庫中查看是亂碼,以為是Hibernate的問題。發現其他的資料都是正常的。

java.io.InputStream ss = repositoryService.getResourceAsStream(deployment,"process.jpdl.xml");   

//在這裡指定字元編碼UTF-8。

BufferedReader in = new BufferedReader(new InputStreamReader(ss,"UTF-8"));

StringBuffer buffer = new StringBuffer();   

 while ((line = in.readLine()) != null){   

                buffer.append(line);   

 }   

 

6.取得我的工作和候選任務。

 

jbpm 中我是用hql擷取自己的當前任務和候選任務,發現重複記錄使用distinct出錯,發現出錯的原因是在JBPM4_TASK表中的欄位為clob類型,我將其修改成nvarchar類型,再使用distinct查詢問題解決了。

StringBuffer hqlSb = new StringBuffer();
   hqlSb.append("select  distinct  task from org.jbpm.pvm.internal.task.TaskImpl task left join task.participations pt where task.assignee=?");
   hqlSb.append(" or  task.assignee is null and  ((pt.type = 'candidate' and   pt.userId =? )  ");

        if (groups.length()> 0) {
          hqlSb.append(" or pt.groupId in (" +groups + ")");
        }
        hqlSb.append(")");
        hqlSb.append(" order by task.createTime desc");

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.