子在川上曰

  逝者如斯夫不舍昼夜
随笔 - 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 本身的配置文件。现在是空的,它用的是缺省配置,你想知道有哪些配置就去看这个文件 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 陈刚 阅读(45442) 评论(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

只有注册用户登录后才能发表评论。


网站导航: