首页

解决jbpm4.4流程demo报"org.jbpm.api.JbpmException: no process definition with key Leave"异常

标签:JbpmException,jbpm4.4     发布时间:2022-11-09   

一、错误描述

执行jbpm4.4的流程demo测试(完整项目demo),报“org.jbpm.api.JbpmException: no process definition with key 'Leave'”错误异常,异常日志如下

org.jbpm.api.JbpmException: no process definition with key 'Leave'@b@	at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:58)@b@	at org.jbpm.pvm.internal.cmd.StartProcessInstanceInLatestCmd.execute(StartProcessInstanceInLatestCmd.java:36)@b@	at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)@b@	at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:50)@b@	at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)@b@	at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)@b@	at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56)@b@	at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)@b@	at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.startProcessInstanceByKey(ExecutionServiceImpl.java:67)@b@	at com.xwood.jbpm4.JBPM4Test.testStartProcessInstance(JBPM4Test.java:35)@b@	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)@b@	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)@b@	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)@b@	at java.lang.reflect.Method.invoke(Method.java:597)@b@	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)@b@	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)@b@	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)@b@	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)@b@	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)@b@	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)@b@	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)@b@	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)@b@	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)@b@	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)@b@	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)@b@	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)@b@	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)@b@	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)@b@	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)@b@	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)@b@	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)@b@	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)@b@### EXCEPTION ###########################################

二、解决方法

修改addResourceFromClasspath的xml流程文件路径(多加Leave目录),具体修改如下(完整项目代码下载

//部署流程定义@b@@Test@b@public void testDeployProcessDefinition() {@b@  processEngine.getRepositoryService()@b@                   .createDeployment()@b@                   .addResourceFromClasspath("leave/Leave.jpdl.xml")@b@                   .addResourceFromClasspath("leave/processimage.png").deploy();@b@}

改为

//部署流程定义@b@@Test@b@public void testDeployProcessDefinition() {@b@    processEngine.getRepositoryService()@b@                                .createDeployment()@b@                                .addResourceFromClasspath("leave/Leave/Leave.jpdl.xml")@b@                                .addResourceFromClasspath("leave/Leave/processimage.jpg").deploy();@b@}

重新运行,日志正常

11:27:20,735 FIN | [WireContext] eagerly initializing org.jbpm.pvm.internal.id.DatabaseIdComposer@b@11:27:20,753 INF | [Environment] Hibernate 3.3.1.GA@b@11:27:20,758 INF | [Environment] hibernate.properties not found@b@11:27:20,762 INF | [Environment] Bytecode provider name : javassist@b@11:27:20,767 INF | [Environment] using JDK 1.4 java.sql.Timestamp handling@b@11:27:20,808 INF | [Configuration] configuring from resource: jbpm.hibernate.cfg.xml@b@11:27:20,808 INF | [Configuration] Configuration resource: jbpm.hibernate.cfg.xml@b@11:27:20,874 INF | [Configuration] Reading mappings from resource : jbpm.repository.hbm.xml@b@11:27:21,030 INF | [Configuration] Reading mappings from resource : jbpm.execution.hbm.xml@b@11:27:21,137 INF | [Configuration] Reading mappings from resource : jbpm.history.hbm.xml@b@11:27:21,177 INF | [Configuration] Reading mappings from resource : jbpm.task.hbm.xml@b@11:27:21,197 INF | [Configuration] Reading mappings from resource : jbpm.identity.hbm.xml@b@11:27:21,213 INF | [Configuration] Configured SessionFactory: null@b@11:27:21,230 INF | [DriverManagerConnectionProvider] Using Hibernate built-in connection pool (not for production use!)@b@11:27:21,230 INF | [DriverManagerConnectionProvider] Hibernate connection pool size: 20@b@11:27:21,230 INF | [DriverManagerConnectionProvider] autocommit mode: false@b@11:27:21,239 INF | [DriverManagerConnectionProvider] using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/jbpm4@b@11:27:21,239 INF | [DriverManagerConnectionProvider] connection properties: {user=root, password=****}@b@11:27:21,455 INF | [Dialect] Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect@b@11:27:21,461 INF | [TransactionFactoryFactory] Using default transaction strategy (direct JDBC transactions)@b@11:27:21,463 INF | [TransactionManagerLookupFactory] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)@b@11:27:21,467 INF | [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory@b@11:27:21,526 INF | [SessionFactoryImpl] building session factory@b@11:27:22,023 INF | [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured@b@11:27:22,297 FIN | [HibernateSessionResource] ----- beginning hibernate tx 28693170 --------------------------------------------------------@b@11:27:22,315 FIN | [SQL] select propertyim0_.KEY_ as KEY1_2_, propertyim0_.VERSION_ as VERSION2_2_, propertyim0_.VALUE_ as VALUE3_2_ from JBPM4_PROPERTY propertyim0_ limit ?@b@11:27:22,327 FST | [StringType] returning 'next.dbid' as column: KEY1_2_@b@11:27:22,334 FST | [IntegerType] returning '0' as column: VERSION2_2_@b@11:27:22,334 FST | [StringType] returning '1' as column: VALUE3_2_@b@11:27:22,341 FIN | [SQL] select propertyim0_.KEY_ as KEY1_2_0_, propertyim0_.VERSION_ as VERSION2_2_0_, propertyim0_.VALUE_ as VALUE3_2_0_ from JBPM4_PROPERTY propertyim0_ where propertyim0_.KEY_=?@b@11:27:22,342 FST | [StringType] binding 'db.version' to parameter: 1@b@11:27:22,343 INF | [CheckDbCmd] jBPM version info: library[4.4-SNAPSHOT], schema[null]@b@11:27:22,348 FIN | [HibernateSessionResource] ----- committing hibernate tx 7163696 -------------------------------------------------------@b@11:27:22,357 FIN | [HibernateSessionResource] ----- beginning hibernate tx 3192321 --------------------------------------------------------@b@11:27:22,394 INF | [Parser] loading schema resource: jpdl-4.0.xsd@b@11:27:22,395 INF | [Parser] loading schema resource: jpdl-4.2.xsd@b@11:27:22,395 INF | [Parser] loading schema resource: jpdl-4.3.xsd@b@11:27:22,395 INF | [Parser] loading schema resource: jpdl-4.4.xsd@b@11:27:22,425 INF | [Parser] loading schema resource: BPMN20.xsd@b@11:27:22,425 INF | [Parser] loading schema resource: DiagramDefinition.xsd@b@11:27:22,425 INF | [Parser] loading schema resource: DiagramInterchange.xsd@b@11:27:22,425 INF | [Parser] loading schema resource: BpmnDi.xsd@b@11:27:22,426 FIN | [DatabaseDbidGenerator] last id -2 was consumed.  acquiring new block...@b@11:27:22,427 FIN | [HibernateSessionResource] ----- beginning hibernate tx 9961972 --------------------------------------------------------@b@11:27:22,455 FIN | [SQL] select this_.KEY_ as KEY1_2_0_, this_.VERSION_ as VERSION2_2_0_, this_.VALUE_ as VALUE3_2_0_ from JBPM4_PROPERTY this_ where this_.KEY_=?@b@11:27:22,455 FST | [StringType] binding 'next.dbid' to parameter: 1@b@11:27:22,456 FST | [StringType] returning 'next.dbid' as column: KEY1_2_0_@b@11:27:22,457 FST | [IntegerType] returning '0' as column: VERSION2_2_0_@b@11:27:22,457 FST | [StringType] returning '1' as column: VALUE3_2_0_@b@11:27:22,466 FIN | [SQL] update JBPM4_PROPERTY set VERSION_=?, VALUE_=? where KEY_=? and VERSION_=?@b@11:27:22,466 FST | [IntegerType] binding '1' to parameter: 1@b@11:27:22,466 FST | [StringType] binding '10001' to parameter: 2@b@11:27:22,466 FST | [StringType] binding 'next.dbid' to parameter: 3@b@11:27:22,467 FST | [IntegerType] binding '0' to parameter: 4@b@11:27:22,468 FIN | [HibernateSessionResource] ----- committing hibernate tx 15592594 -------------------------------------------------------@b@11:27:22,469 FIN | [DatabaseDbidGenerator] acquired new id block [1-10000]@b@11:27:22,485 FIN | [SQL] select lob_.DBID_, lob_.DBVERSION_ as DBVERSION2_5_, lob_.BLOB_VALUE_ as BLOB3_5_ from JBPM4_LOB lob_ where lob_.DBID_=?@b@11:27:22,486 FST | [LongType] binding '2' to parameter: 1@b@11:27:22,487 FIN | [SQL] select lob_.DBID_, lob_.DBVERSION_ as DBVERSION2_5_, lob_.BLOB_VALUE_ as BLOB3_5_ from JBPM4_LOB lob_ where lob_.DBID_=?@b@11:27:22,487 FST | [LongType] binding '3' to parameter: 1@b@11:27:22,488 WRN | [DeployerManager] WARNING: no objects were deployed! Check if you have configured a correct deployer in your jbpm.cfg.xml file for the type of deployment you want to do.@b@11:27:22,492 FIN | [SQL] insert into JBPM4_DEPLOYMENT (NAME_, TIMESTAMP_, STATE_, DBID_) values (?, ?, ?, ?)@b@11:27:22,492 FST | [TextType] binding null to parameter: 1@b@11:27:22,493 FST | [LongType] binding '0' to parameter: 2@b@11:27:22,493 FST | [StringType] binding 'active' to parameter: 3@b@11:27:22,493 FST | [LongType] binding '1' to parameter: 4@b@11:27:22,494 FIN | [SQL] insert into JBPM4_LOB (DBVERSION_, BLOB_VALUE_, DBID_) values (?, ?, ?)@b@11:27:22,495 FST | [IntegerType] binding '0' to parameter: 1@b@11:27:22,495 FST | [LongType] binding '2' to parameter: 3@b@11:27:22,495 FIN | [SQL] insert into JBPM4_LOB (DBVERSION_, BLOB_VALUE_, DBID_) values (?, ?, ?)@b@11:27:22,498 FST | [IntegerType] binding '0' to parameter: 1@b@11:27:22,498 FST | [LongType] binding '3' to parameter: 3@b@11:27:22,502 FIN | [SQL] update JBPM4_LOB set DEPLOYMENT_=?, NAME_=? where DBID_=?@b@11:27:22,503 FST | [LongType] binding '1' to parameter: 1@b@11:27:22,503 FST | [TextType] binding 'leave/Leave/processdefinition.xml' to parameter: 2@b@11:27:22,504 FST | [LongType] binding '2' to parameter: 3@b@11:27:22,504 FIN | [SQL] update JBPM4_LOB set DEPLOYMENT_=?, NAME_=? where DBID_=?@b@11:27:22,504 FST | [LongType] binding '1' to parameter: 1@b@11:27:22,505 FST | [TextType] binding 'leave/Leave/processimage.jpg' to parameter: 2@b@11:27:22,505 FST | [LongType] binding '3' to parameter: 3@b@11:27:22,510 FIN | [HibernateSessionResource] ----- committing hibernate tx 10329821 -------------------------------------------------------
<<推荐下载>>
  • (1) 阿里巴巴Java开发手册8种不同版本
  • (2) Web前端开发视频教程
  • (3) 30+明星讲师PPT课件分享一线大厂架构实战经验
  • (4) java开发_架构篇_视频资源分享_v2208
  • (5) java开发_高级篇_视频资源分享_v2208
  • (6) java开发_进阶篇(中级)_视频资源分享_v2208
  • (7) java开发_入门篇_视频资源分享_v2208
  • (8) 微信小程序开发视频1+167源码+实战demo等下载
  • (9) easy-shopping电子商务java源码(附脚本和安装文档说明)下载
  • (10) java常用的72份知名实用的电子书下载
  • (11) java开发性能优化资料整理大全(8份电子文档+3份实战优化)下载
  • (12) 9个常用的算法设计资料和100以上视频课件内容下载
  • (13) vue开发必备常用手册16件下载
  • (14) 21种不同技术集群方案(es、flink、redis、nginx、zk、lvs、kafka、mysql、k8s等)参考资料下载
  • (15) 20种技术代码规范(js/java/dba/阿里/华为/oracle/mysql等)参考资料下载
  • (16) 微服务五套资料(0-1,架构设计,springcloud,nacos等)下载
  • (17) 架构师(28知识图谱+3套简历模板+6套架构实战文档等)完整资料整理下载
  • (18) 大数据18套实战基础知识+8套简历模板下载
  • (19) 并发编程全套(7套+阿里巴巴+亿级实战等)实战资料下载
  • (20) Kafka九套学习整理知识点全套(面试+笔记+代码api+命令+容备等)资料下载
  • (21) java全套9个不同方向类型的面试题(基础+核心+大厂+架构师+近万套题库等)下载
  • (22) JAVA开发常用API帮助文档大全(超52种以上技术资料,高手必备)下载
  • (23) springcloud超详细139件全套学习实战资料( 视频课件+源码demo+文档资料等)下载
  • 更多推荐>>
  • <<热门文章>>