论坛首页 Java企业应用论坛

JBoss JBPM 实践系列(一)--- 安装配置(Tomcat 6.0 + MySQL 5.1)

浏览 43843 次
精华帖 (0) :: 良好帖 (5) :: 新手帖 (0) :: 隐藏帖 (8)
作者 正文
   发表时间:2008-07-08  

JBoss JBPM 实践系列(一)--- 安装配置(Tomcat 6.0 + MySQL 5.1)

 

       jBPM,全称是Java Business Process Management,是一种基于J2EE的轻量级工作流管理系统。jBPM是公开源代码项目,遵循Apache License。jBPM在2004年10月18日,发布了2.0版本,并在同一天加入了JBoss,成为了JBoss企业中间件平台的一个组成部分,它的名称也改成JBoss jBPM。

 

       jBPM有两大特色,使他成为市场的一大两点。其中最大的特色就是它的业务逻辑定义没有采用目前的一些规范,如WfMC´s XPDL, BPML, ebXML, BPEL4WS等,而是它自己定义的JBoss jBPM Process definition language (jPdl)。jPdl把一个业务逻辑流程看作是一个UML状态图,如果你不熟悉UML状态图,那初学计算机语言的流程图应该熟悉吧,表达的方式和意思大同小异。jPdl详细定义了这个状态图的每个部分,如起始、结束状态,状态之间的转换等;其另一大特色就是集成Hibernate,确切的说是绑定,使用Hibernate来管理数据库,这样jBPM只专注于他的业务流程控制。

 

       从上面可以看出,jBPM是一个业务流程管理引擎,是一个工作流引擎。除此之外,它同时实现了对jPDL和对BPEL的支持。它整合了Hibernate技术处理数据库,创建了一系列的数据库表,持久化工作流引擎所需的状态。因此,jBPM支持所有Hibernate支持的数据库,能够把Java对象持久化到数据库中,把Hibernate支持的Java类的对象保存到数据库中!

     

       你完全可以像用 Java 的类库一样使用JBoss jBPM,而且通过配置JBoss jBPM也可以被部署在其它J2EE应用服务器上和任何数据库上。

 

       在本文中,我们首先来创建我们的JBoss jBPM运行开发环境。在开始之前,请准备一下软件产品:

·JDK 1.5 或者更高版本, 这里使用JDK 6u10b

·Apache Tomcat 5.5.x或更高版本,这里使用Tomcat 6.0.16

·MySQL 5.1 ,也可以选择其它Hiberante 支持的数据库,没有太大差别,这里使用MySQL 5.1

·Apache Ant 1.7.0

·JBPM-3.2.3

·Eclipse EuropaEclipse V3.3 for JavaEE Developers或更高, 这里使用Eclipse V3.4

 

说明:JBoss jBPM的发布包中已经配置好了一套服务环境,是基于JBoss的。因为我们习惯了Tomcat 的小巧灵活,而且我们也不希望jBPM依赖JBoss。

 

1. 下载安装JDK,Tomcat, Ant, MySQL, 并设置相应的环境变量

 此步骤不再熬述,具体请查阅官方文档

  Jdkhttp://java.sun.com/

  Anthttp://ant.apache.org/

Tomcathttp://tomcat.apache.org/

 Eclipse:http://www.eclipse.org/

 

 2. 下载JBoss jBPM

JBoss jBPM 官方(http://www.jboss.org/jbossjbpm/)当前发布的版本为 3.2.3, 只需要下载jPDL Suite,下载后得到jbpm-jpdl-suite-3.2.3.zip,这个套件包含了所有的内容和资源,包括eclipse插件,示例,和流程管理控制应用。

解压jbpm-jpdl-suite-3.2.3.zip,这里解压后得到D:\jbpm-jpdl-3.2.3,其主要目录结构如下:

D:\jbpm-jpdl-3.2.3

|--- db    这里都是些sql定义和数据文件,如果改用其它数据库,可以使用这些资源来创建,服务还是很周到的。顺便

|             罗嗦一句,jBPM 默认使用的是内存数据库 hsqldb ,这个数据库还没研究过(嘿嘿---)

|

|--- deploy  用来部署你的应用的包和资源

|

|--- designer  这里是Eclipse插件,这样你就可以在图形界面来定义你的业务流程,骨灰级人物没他也能过日子

|

|--- doc  这里是jBPM相关组件的API 文档

|

|--- examples  这里是些学习的例子

|

|--- lib  jBPM 的类库

|

|--- server  这里有一个JBoss 服务器,并且包含了本JBoss jBPM引擎,还部署了websale例子

|

|--- src  这里是JBoss jBPM的源代码

 

 

      3. 配置数据库

      jBPM需要把初始化数据和工作流定义存储到数据库中,它定义了一套数据结构来存储这些数据,这也是该容器本身的特点。

 

      在mysql 中创建一个数据库 jbpm ,(create database jbpm;),并创建用户jbossjbpm(密码:jbossjbpm)

      说明:如果你嫌麻烦可以使用root账号和其密码,不过下面的设置请做相应的更改

 

      在D:\jbpm-jpdl-3.2.3\db 找到jbpm.jpdl.mysql.sql, 该文件必须修改一下,以符合MySQL的语法结构。具体就是在每条语句的末尾增加一个分号";"你可以借助 UltrEdit, EditPlus等工具来做这些事情(注意替换时要注意匹配大小写,有写表的字段中包含CREATE字符),如果是第一次创建这些数据库表,要删除create语句上面的alter和drop(这些表还都不存在)。

 

 

      4. 准备jBPM包

      这是个jbpm-jpdl流程管理控制台,就像Tomcat有个单独的Administrator应用用来管理配置和部署一样的东东。有了他你可以在图形界面来操作控制你的应用。

 

      打开命令行控制台,切换到D:\jbpm-jpdl-3.2.3\deploy 目录,执行以下命令:

      ant customize.console.for.tomcat

  

    注意:请确保你的ant安装配置妥当,可以在命令行输入:ant -version 来检测ant 是否正确安装。命令执行后能看到ant的版本信息即OK

 

    ant customize.console.for.tomcat 执行成功后,会在D:\jbpm-jpdl-3.2.3\deploy 目录下生成customized和target目录,其中customized目录下的jbpm-console.war即是我们想要的war包。

       我们需要修改jbpm-console.war/WEB-INF/classes/hibernate.cfg.xml 文件,以适应我们的资源属性的需要。修改后的结果如下:

<hibernate-configuration>
  <session-factory>

    <!-- hibernate dialect -->
    <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>

    <!-- JDBC connection properties (begin) -->
    <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">jbossjbpm</property>
    <property name="hibernate.connection.password">jbossjbpm</property>
     <!-- JDBC connection properties (end) -->
    
    <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
    
    <!-- DataSource properties (begin) ==
    <property name="hibernate.connection.datasource">java:/JbpmDS</property>
    == DataSource properties (end) -->
    <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
...	

 

       这里就是启用了 更换了默认的数据属性,JDBC connection properties ,还有自己定义的数据名字和帐号,另外需要注意的是用

<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>

 

代替JTATransactionFactory和CMTTransactionFactory,想用JTATransactionFactory或CMTTransactionFactory配置也可以,不过还没有研究过,有知道的朋友可以一起学习一下。

 

   

       拷贝jboss-j2ee.jar包至jbpm-console.war/WEB-INF/lib 。发布包下(D:\jbpm-jpdl-3.2.3)很多地方都有这个包你可以找一下,比如 D:\jbpm-jpdl-3.2.3\server\client。

       这里主要是用到了Java Transaction Architecture, 所以你可以用J2EE中的jta.jar包还替换jboss-j2ee.jar。jta相关信息请参考:http://java.sun.com/javaee/technologies/jta/index.jsp

 

        拷贝commons-collections.jar 包至jbpm-console.war/WEB-INF/lib  。发布包下(D:\jbpm-jpdl-3.2.3)好几处都有这个包,比如 D:\jbpm-jpdl-3.2.3\server\server\jbpm\lib 。这个包是Apache Commons包,到处都找的的到。

 

        拷贝jsf-api.jar和jsf-impl.jar包至jbpm-console.war/WEB-INF/lib ,你可以在D:\jbpm-jpdl-3.2.3\server\server\jbpm\deploy\jboss-web.deployer\jsf-libs种找到这两个包。

        说明:因为jbpm-console是一个jsf应用,没这两个包,你访问时会报404或505错误。

 

        拷贝MySQL JDBC驱动程序包至%CATALINA_HOME%/lib (Tomcat 6)或%CATALINA_HOME%/common/lib(Tomcat 5.5)

       

 

        拷贝修改后的jbpm-console至%CATALINA_HOME%/webapps

 

        这样jBPM基本上配置完成,但是我们还不能访问他,还需要配置安全访问控制和初始的用户数据

 

 

        5. 配置Tomcat 安全域

        方法一:在%CATALINA_HOME%/conf/Catalina/localhost 创建一个jbpm-console.xml 文件,内容如下:

<Context>
<Realm  className="org.apache.catalina.realm.JDBCRealm" 
	driverName="com.mysql.jdbc.Driver"
	connectionURL="jdbc:mysql://localhost:3306/jbpm"
	connectionName="jbossjbpm" 
	connectionPassword="jbossjbpm"
	userTable="JBPM_ID_USER u, JBPM_ID_MEMBERSHIP m, JBPM_ID_GROUP g" 
	userNameCol="g.TYPE_ = 'security-role' AND m.GROUP_ = g.ID_ AND m.USER_ = u.ID_ AND u.NAME_" 
	userCredCol="DISTINCT u.PASSWORD_"
	userRoleTable="JBPM_ID_USER u, JBPM_ID_MEMBERSHIP m, JBPM_ID_GROUP g" 
	roleNameCol="g.NAME_" />
</Context>

 

         方法二:修改 %CATALINA_HOME%/conf/tomcat-users.xml文件来设置安全域。为了不和tomcat已有的用户冲突,这里把 tomcat以前的登陆帐号username="admin" 修改为username="tadmin",修改后的文件如下:

 

<?xml version='1.0' encoding='utf-8'?>

<tomcat-users>

  <role rolename="user"/>

  <role rolename="administrator"/>

  <role rolename="manager"/>

  <role rolename="sales"/>

  <role rolename="hr"/>

  <role rolename="admin"/>

  <role rolename="participant"/>

  <user username="user" password="user" roles="user,sales"/>

  <user username="shipper" password="shipper" roles="user,hr"/>

  <user username="manager" password="manager" roles="admin,hr,manager,user,sales"/>

  <user username="tadmin" password="" roles="admin,manager"/>
  <user username="admin" password="admin" roles="admin,user,hr"/>
</tomcat-users>

 

         6. 初始化数据

         在MySQL jbpm数据库中插入以下数据

INSERT INTO JBPM_ID_GROUP VALUES(1,'G','sales','organisation',NULL);

INSERT INTO JBPM_ID_GROUP VALUES(2,'G','admin','security-role',NULL);

INSERT INTO JBPM_ID_GROUP VALUES(3,'G','user','security-role',NULL);

INSERT INTO JBPM_ID_GROUP VALUES(4,'G','hr','organisation',NULL);

INSERT INTO JBPM_ID_GROUP VALUES(5,'G','manager','security-role',NULL);

INSERT INTO JBPM_ID_USER VALUES(1,'U','user','user@sample.domain','user');

INSERT INTO JBPM_ID_USER VALUES(2,'U','manager','manager@sample.domain','manager');

INSERT INTO JBPM_ID_USER VALUES(3,'U','admin','admin@sample.domain','admin');

INSERT INTO JBPM_ID_USER VALUES(4,'U','shipper','shipper@sample.domain','shipper');

INSERT INTO JBPM_ID_MEMBERSHIP VALUES(1,'M',NULL,NULL,2,4);

INSERT INTO JBPM_ID_MEMBERSHIP VALUES(2,'M',NULL,NULL,3,4);

INSERT INTO JBPM_ID_MEMBERSHIP VALUES(3,'M',NULL,NULL,4,4);

INSERT INTO JBPM_ID_MEMBERSHIP VALUES(4,'M',NULL,NULL,4,3);

INSERT INTO JBPM_ID_MEMBERSHIP VALUES(5,'M',NULL,NULL,1,3);

INSERT INTO JBPM_ID_MEMBERSHIP VALUES(6,'M',NULL,NULL,2,3);

INSERT INTO JBPM_ID_MEMBERSHIP VALUES(7,'M',NULL,NULL,3,3);

INSERT INTO JBPM_ID_MEMBERSHIP VALUES(8,'M',NULL,NULL,3,2);

INSERT INTO JBPM_ID_MEMBERSHIP VALUES(9,'M',NULL,NULL,2,2);

INSERT INTO JBPM_ID_MEMBERSHIP VALUES(10,'M',NULL,NULL,2,5);

INSERT INTO JBPM_ID_MEMBERSHIP VALUES(11,'M',NULL,'boss',2,1);

INSERT INTO JBPM_ID_MEMBERSHIP VALUES(12,'M',NULL,NULL,1,1);

 

      7. 启动Tomcat 服务,查看控制台的日志,排除错误,数据库错误和支持库不完整都可能导致错误。

      在浏览器中输入:http://localhost:8080/jbpm 能正常访问说明部署成功,你可以用页面上列出的用户和账号登陆进去体验一下。

 

 

   

   发表时间:2008-07-16  
信息: Not binding factory to JNDI, no JNDI name configured

好象配置中没有涉及到jndi的配置,我的tomcat 6.0 怎么会抛出这问题,就运行不过去了
0 请登录后投票
   发表时间:2008-07-16  
信息: Not binding factory to JNDI, no JNDI name configured

这个不用管他,不是错误。如果没有其他问题,你就可以在浏览器中访问看看
0 请登录后投票
   发表时间:2008-07-20  
信息: Mapping collection: org.jbpm.identity.Group.memberships -> JBPM_ID_MEMBERS
HIP
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.graph.def.ProcessDefinition.events -> JBPM_EV
ENT
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.graph.def.ProcessDefinition.exceptionHandlers
-> JBPM_EXCEPTIONHANDLER
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.graph.def.ProcessDefinition.nodes -> JBPM_NOD
E
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.graph.def.ProcessDefinition.actions -> JBPM_A
CTION
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.graph.def.ProcessDefinition.definitions -> JB
PM_MODULEDEFINITION
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.graph.def.Node.events -> JBPM_EVENT
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.graph.def.Node.exceptionHandlers -> JBPM_EXCE
PTIONHANDLER
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.graph.def.Node.leavingTransitions -> JBPM_TRA
NSITION
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.graph.def.Node.arrivingTransitions -> JBPM_TR
ANSITION
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.graph.def.Transition.events -> JBPM_EVENT
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.graph.def.Transition.exceptionHandlers -> JBP
M_EXCEPTIONHANDLER
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.graph.def.Event.actions -> JBPM_ACTION
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.graph.def.SuperState.nodes -> JBPM_NODE
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.graph.def.ExceptionHandler.actions -> JBPM_AC
TION
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.graph.action.Script.variableAccesses -> JBPM_
VARIABLEACCESS
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.graph.node.ProcessState.variableAccesses -> J
BPM_VARIABLEACCESS
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.graph.node.TaskNode.tasks -> JBPM_TASK
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.file.def.FileDefinition.processFiles -> JBPM_
BYTEARRAY
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.taskmgmt.def.TaskMgmtDefinition.swimlanes ->
JBPM_SWIMLANE
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.taskmgmt.def.TaskMgmtDefinition.tasks -> JBPM
_TASK
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.taskmgmt.def.Swimlane.tasks -> JBPM_TASK
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.taskmgmt.def.Task.events -> JBPM_EVENT
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.taskmgmt.def.Task.exceptionHandlers -> JBPM_E
XCEPTIONHANDLER
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.taskmgmt.def.TaskController.variableAccesses
-> JBPM_VARIABLEACCESS
2008-7-20 14:17:41 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.graph.exe.ProcessInstance.runtimeActions -> J
BPM_RUNTIMEACTION
2008-7-20 14:17:42 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.graph.exe.ProcessInstance.instances -> JBPM_M
ODULEINSTANCE
2008-7-20 14:17:42 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.graph.exe.Token.children -> JBPM_TOKEN
2008-7-20 14:17:42 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.graph.exe.Token.comments -> JBPM_COMMENT
2008-7-20 14:17:42 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.context.exe.ContextInstance.tokenVariableMaps
-> JBPM_TOKENVARIABLEMAP
2008-7-20 14:17:42 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.context.exe.TokenVariableMap.variableInstance
s -> JBPM_VARIABLEINSTANCE
2008-7-20 14:17:42 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.taskmgmt.exe.TaskMgmtInstance.swimlaneInstanc
es -> JBPM_SWIMLANEINSTANCE
2008-7-20 14:17:42 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.taskmgmt.exe.TaskMgmtInstance.taskInstances -
> JBPM_TASKINSTANCE
2008-7-20 14:17:42 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.taskmgmt.exe.TaskInstance.variableInstances -
> JBPM_VARIABLEINSTANCE
2008-7-20 14:17:42 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.taskmgmt.exe.TaskInstance.comments -> JBPM_CO
MMENT
2008-7-20 14:17:42 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.taskmgmt.exe.SwimlaneInstance.pooledActors ->
JBPM_POOLEDACTOR
2008-7-20 14:17:42 org.hibernate.cfg.HbmBinder bindCollectionSecondPass
信息: Mapping collection: org.jbpm.logging.log.CompositeLog.children -> JBPM_LOG

2008-7-20 14:17:42 org.hibernate.util.NamingHelper getInitialContext
信息: JNDI InitialContext properties:{}
2008-7-20 14:17:42 org.hibernate.connection.DatasourceConnectionProvider configu
re
信息: Using datasource: java:comp/env/jdbc/JbpmDataSource
2008-7-20 14:17:42 org.hibernate.dialect.Dialect <init>
信息: Using dialect: org.hibernate.dialect.MySQLInnoDBDialect
2008-7-20 14:17:42 org.hibernate.transaction.TransactionFactoryFactory buildTran
sactionFactory
信息: Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
2008-7-20 14:17:42 org.hibernate.transaction.TransactionManagerLookupFactory get
TransactionManagerLookup
信息: No TransactionManagerLookup configured (in JTA environment, use of read-wr
ite or transactional second-level cache is not recommended)
2008-7-20 14:17:42 org.hibernate.cfg.SettingsFactory buildSettings
信息: Automatic flush during beforeCompletion(): disabled
2008-7-20 14:17:42 org.hibernate.cfg.SettingsFactory buildSettings
信息: Automatic session close at end of transaction: disabled
2008-7-20 14:17:42 org.hibernate.cfg.SettingsFactory buildSettings
信息: Scrollable result sets: disabled
2008-7-20 14:17:42 org.hibernate.cfg.SettingsFactory buildSettings
信息: JDBC3 getGeneratedKeys(): disabled
2008-7-20 14:17:42 org.hibernate.cfg.SettingsFactory buildSettings
信息: Connection release mode: auto
2008-7-20 14:17:42 org.hibernate.cfg.SettingsFactory buildSettings
信息: Maximum outer join fetch depth: 2
2008-7-20 14:17:42 org.hibernate.cfg.SettingsFactory buildSettings
信息: Default batch fetch size: 1
2008-7-20 14:17:42 org.hibernate.cfg.SettingsFactory buildSettings
信息: Generate SQL with comments: disabled
2008-7-20 14:17:42 org.hibernate.cfg.SettingsFactory buildSettings
信息: Order SQL updates by primary key: disabled
2008-7-20 14:17:42 org.hibernate.cfg.SettingsFactory createQueryTranslatorFactor
y
信息: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
2008-7-20 14:17:42 org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
信息: Using ASTQueryTranslatorFactory
2008-7-20 14:17:42 org.hibernate.cfg.SettingsFactory buildSettings
信息: Query language substitutions: {}
2008-7-20 14:17:42 org.hibernate.cfg.SettingsFactory buildSettings
信息: JPA-QL strict compliance: disabled
2008-7-20 14:17:42 org.hibernate.cfg.SettingsFactory buildSettings
信息: Second-level cache: enabled
2008-7-20 14:17:42 org.hibernate.cfg.SettingsFactory buildSettings
信息: Query cache: disabled
2008-7-20 14:17:42 org.hibernate.cfg.SettingsFactory createCacheProvider
信息: Cache provider: org.hibernate.cache.HashtableCacheProvider
2008-7-20 14:17:42 org.hibernate.cfg.SettingsFactory buildSettings
信息: Optimize cache for minimal puts: disabled
2008-7-20 14:17:42 org.hibernate.cfg.SettingsFactory buildSettings
信息: Structured second-level cache entries: disabled
2008-7-20 14:17:42 org.hibernate.cfg.SettingsFactory buildSettings
信息: Statistics: disabled
2008-7-20 14:17:42 org.hibernate.cfg.SettingsFactory buildSettings
信息: Deleted entity synthetic identifier rollback: disabled
2008-7-20 14:17:42 org.hibernate.cfg.SettingsFactory buildSettings
信息: Default entity-mode: pojo
2008-7-20 14:17:42 org.hibernate.cfg.SettingsFactory buildSettings
信息: Named query checking : enabled
2008-7-20 14:17:42 org.hibernate.impl.SessionFactoryImpl <init>
信息: building session factory
2008-7-20 14:17:43 org.hibernate.impl.SessionFactoryObjectFactory addInstance
信息: Not binding factory to JNDI, no JNDI name configured
2008-7-20 14:17:43 org.jbpm.job.executor.JobExecutorThread run
严重: exception in job executor thread. waiting 5000 milliseconds
java.lang.UnsupportedOperationException: Not supported by BasicDataSource
        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSo
urce.java:899)
        at org.hibernate.connection.DatasourceConnectionProvider.getConnection(D
atasourceConnectionProvider.java:66)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager
.java:423)
        at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.
java:144)
        at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
        at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:
57)
        at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326
)
        at org.jbpm.persistence.db.DbPersistenceService.beginTransaction(DbPersi
stenceService.java:132)
        at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistence
Service.java:124)
        at org.jbpm.persistence.db.DbPersistenceService.getJobSession(DbPersiste
nceService.java:363)
        at org.jbpm.JbpmContext.getJobSession(JbpmContext.java:563)
        at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread
.java:112)
        at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:58
)
2008-7-20 14:17:48 org.jbpm.job.executor.JobExecutorThread run
严重: exception in job executor thread. waiting 10000 milliseconds
java.lang.UnsupportedOperationException: Not supported by BasicDataSource
        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSo
urce.java:899)
        at org.hibernate.connection.DatasourceConnectionProvider.getConnection(D
atasourceConnectionProvider.java:66)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager
.java:423)
        at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.
java:144)
        at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
        at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:
57)
        at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326
)
        at org.jbpm.persistence.db.DbPersistenceService.beginTransaction(DbPersi
stenceService.java:132)
        at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistence
Service.java:124)
        at org.jbpm.persistence.db.DbPersistenceService.getJobSession(DbPersiste
nceService.java:363)
        at org.jbpm.JbpmContext.getJobSession(JbpmContext.java:563)
        at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread
.java:112)
        at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:58
)
2008-7-20 14:17:58 org.jbpm.job.executor.JobExecutorThread run
严重: exception in job executor thread. waiting 20000 milliseconds
java.lang.UnsupportedOperationException: Not supported by BasicDataSource
        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSo
urce.java:899)
        at org.hibernate.connection.DatasourceConnectionProvider.getConnection(D
atasourceConnectionProvider.java:66)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager
.java:423)
        at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.
java:144)
        at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
        at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:
57)
        at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326
)
        at org.jbpm.persistence.db.DbPersistenceService.beginTransaction(DbPersi
stenceService.java:132)
        at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistence
Service.java:124)
        at org.jbpm.persistence.db.DbPersistenceService.getJobSession(DbPersiste
nceService.java:363)
        at org.jbpm.JbpmContext.getJobSession(JbpmContext.java:563)
        at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread
.java:112)
        at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:58
)
2008-7-20 14:18:18 org.jbpm.job.executor.JobExecutorThread run
严重: exception in job executor thread. waiting 40000 milliseconds
java.lang.UnsupportedOperationException: Not supported by BasicDataSource
        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSo
urce.java:899)
        at org.hibernate.connection.DatasourceConnectionProvider.getConnection(D
atasourceConnectionProvider.java:66)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager
.java:423)
        at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.
java:144)
        at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
        at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:
57)
        at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326
)
        at org.jbpm.persistence.db.DbPersistenceService.beginTransaction(DbPersi
stenceService.java:132)
        at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistence
Service.java:124)
        at org.jbpm.persistence.db.DbPersistenceService.getJobSession(DbPersiste
nceService.java:363)
        at org.jbpm.JbpmContext.getJobSession(JbpmContext.java:563)
        at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread
.java:112)
        at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:58
)
2008-7-20 14:18:58 org.jbpm.job.executor.JobExecutorThread run
严重: exception in job executor thread. waiting 80000 milliseconds
java.lang.UnsupportedOperationException: Not supported by BasicDataSource
        at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSo
urce.java:899)
        at org.hibernate.connection.DatasourceConnectionProvider.getConnection(D
atasourceConnectionProvider.java:66)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager
.java:423)
        at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.
java:144)
        at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
        at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:
57)
        at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326
)
        at org.jbpm.persistence.db.DbPersistenceService.beginTransaction(DbPersi
stenceService.java:132)
        at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistence
Service.java:124)
        at org.jbpm.persistence.db.DbPersistenceService.getJobSession(DbPersiste
nceService.java:363)
        at org.jbpm.JbpmContext.getJobSession(JbpmContext.java:563)
        at org.jbpm.job.executor.JobExecutorThread.acquireJobs(JobExecutorThread
.java:112)
        at org.jbpm.job.executor.JobExecutorThread.run(JobExecutorThread.java:58
)
=======================================================================================
=======================================================================================
我用的环境几乎和你一样可是不知道怎么老出这个错误。您能帮我解答一下么?
0 请登录后投票
   发表时间:2008-07-20  
请你先确定一下,你的classpath路径下是否有hibernate3.jar 和 mysql-connector-java.jar(%CATALINA_HOME%\lib 下),仔细检查一下自己是否疏忽了哪个环节,我这里屡试不爽
0 请登录后投票
   发表时间:2008-07-20  
在你的log中有下面这行:
信息: Using datasource: java:comp/env/jdbc/JbpmDataSource
2008-7-20 14:17:42 org.hibernate.dialect.Dialect <init>


说明你的hibernate.cfg.xml没有按文中描述的方法去做。

    ……
    <!-- DataSource properties (begin) ===
    <property name="hibernate.connection.datasource">java:comp/env/jdbc/JbpmDataSource</property>
    === DataSource properties (end) -->
    ……

JbpmDataSource 是被注释了的
0 请登录后投票
   发表时间:2008-07-21  
谢谢阿!我知道了。已经成功了。
原来这句话得注释掉
0 请登录后投票
   发表时间:2008-07-21  
适用工作流有什么好处? 它位于哪一层? 既然工作流是业务流程管理引擎,那就是位于业务层了吗?  该如何把jbpm集成到web应用系统架构中呢? 
0 请登录后投票
   发表时间:2008-07-23  
我可以给你一点建议,jBPM是和 Herbinate 绑定的,如何你做过 ssh (Struts + Spring + Hibernate) 我想你会比较容易找到感觉。网上已经有很多例子了,你可以参考一下。
有空我再整一篇集成的例子出来吧,现在项目紧张,无暇分身呐!
0 请登录后投票
   发表时间:2008-07-23  
hi,又是我

1.hibernate配置
<hibernate-configuration>
  <session-factory>

    <!-- hibernate dialect -->
    <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>

    <!-- JDBC connection properties (begin) === -->
       <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">jbpm</property>
    <property name="hibernate.connection.password">jbpm</property>
   <!-- ==== JDBC connection properties (end) -->
   
    <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
    <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property> 

其他没改动过

2.安全域的配置 是copy你的。


现在问题是,我跑jbpm-jpdl-3.2版本的,就一登录出现
Access to the requested resource has been denied

description Access to the specified resource (Access to the requested resource has been denied) has been forbidden.

如果跑jbpm-jpdl-3.2.2版本,就是404错误。如下:
message /jbpm-console/search/tasks.jsf

description The requested resource (/jbpm-console/search/tasks.jsf) is not available.

但我jsf的两个jar包都加了。

郁闷了,望你指导,指导。
0 请登录后投票
论坛首页 Java企业应用版

跳转论坛:
Global site tag (gtag.js) - Google Analytics