JBPM配置错误解析

原文链接:http://www.cnblogs.com/shiyangxt/archive/2009/03/06/1404926.html

 

                    本来是写了挺多的开场白的,和我的使用JBPM感想的,但是因为我的苹果浏览器突然冒出了一个内存错误,自动关闭了

,所以我写的一大票东西都白写了,咳~~,真是点背,搞得我也没心情在重打一遍了。算了长话短说吧。

                    JBPM是一个OA办公自动化的开源框架或者叫它开源组件也可以。这个东东可以让我们方便的书写流程逻辑,并且很轻松

的应付复杂多变的需求,提高了开发效率。但是不用这个技术,也可以实现工作流,只不过就比较不专业,需求实现起来比较慢。但是这个

框架的学习坡度很陡,不好学,所以这也是这方面资料不多的一个原因。这个框架的底层数据操作是hibernate,但是他封装了sessionFactory

和session以及事务。提供了一套自己的以任务为主体的工作流程实现。封装了hibernate的方法,而且比较不好懂,不过学习一下其中的

实现思路和流程设计技巧也挺不错的。我也是通过几个例子才渐渐了解了这个框架。网上的资料千篇一律都是讲的与J2SE和Junit的整合,

其中不免贴过来贴过去,我这篇帖子没准也是这种命运,搞得最后也不知道这篇文章的作者是谁了,呵呵。我讲的是J2EE与JBPM的整合,

因为随着技术的发展,环境之间的更新换代,造成了很多配置的错误。所以我想总结一下。本来不想写这么多的,还是说了这么多。

 

使用环境:MyEclipse6.5,Mysql5,hibernate3.2,jbpm-starters-kit-3.1.2,ant1.7.1。

第一个会造成错误的就是:表结构的字段错误,修改方法就是更新表字段。

ALTER TABLE JBPM_PROCESSDEFINITION MODIFY ISTERMINATIONIMPLICIT_ TINYINT(1);    
ALTER TABLE JBPM_ACTION MODIFY ISASYNC_ TINYINT(1);    
ALTER TABLE JBPM_ACTION MODIFY ISPROPAGATIONALLOWED_ TINYINT(1);    
ALTER TABLE JBPM_NODE MODIFY ISASYNC_ TINYINT(1);    
ALTER TABLE JBPM_NODE MODIFY ISASYNCEXCL_ TINYINT(1);    
ALTER TABLE JBPM_NODE MODIFY CREATETASKS_ TINYINT(1);    
ALTER TABLE JBPM_NODE MODIFY ENDTASKS_ TINYINT(1);    
ALTER TABLE JBPM_PROCESSINSTANCE MODIFY ISSUSPENDED_ TINYINT(1);    
ALTER TABLE JBPM_TASK MODIFY ISBLOCKING_ TINYINT(1);    
ALTER TABLE JBPM_TASK MODIFY ISSIGNALLING_ TINYINT(1);    
ALTER TABLE JBPM_TASKINSTANCE MODIFY ISCANCELLED_ TINYINT(1);    
ALTER TABLE JBPM_TASKINSTANCE MODIFY ISSUSPENDED_ TINYINT(1);    
ALTER TABLE JBPM_TASKINSTANCE MODIFY ISOPEN_ TINYINT(1);    
ALTER TABLE JBPM_TASKINSTANCE MODIFY ISSIGNALLING_ TINYINT(1);    
ALTER TABLE JBPM_TASKINSTANCE MODIFY ISBLOCKING_ TINYINT(1);    
ALTER TABLE JBPM_TOKEN MODIFY ISABLETOREACTIVATEPARENT_ TINYINT(1);    
ALTER TABLE JBPM_TOKEN MODIFY ISTERMINATIONIMPLICIT_ TINYINT(1);    
ALTER TABLE JBPM_TOKEN MODIFY ISSUSPENDED_ TINYINT(1);  

 

我有一句更新出错,但是不影响下一步的操作。

第二个需要注意的是web.xml的配置:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi
="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation
="http://java.sun.com/xml/ns/javaee 
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
>
    
<filter>
        
<filter-name>JbpmContextFilter</filter-name>
        
<filter-class>org.jbpm.web.JbpmContextFilter</filter-class>
    
</filter>
    
<filter-mapping>
        
<filter-name>JbpmContextFilter</filter-name>
        
<url-pattern>/*</url-pattern>
    
</filter-mapping>
    
<welcome-file-list>
        
<welcome-file>index.jsp</welcome-file>
    
</welcome-file-list>
</web-app>

 

第三个需要注意的是MyFace的jar包引入问题,因为我们的项目一般不需要使用Myface技术,所以这两个jbpm配置包

是多余的,不删掉的话,Myeclipse会报错。包名:myfaces-api.jar,myfaces-impl.jar。

第四个需要注意的就是common jar包的引入,可能会与tomcat或其他的web服务器内的common的jar包有版本冲突。

所以可以删除其一,我建议删jbpm的common jar包。

第五就是需要添加hibernate支持,否则Myeclipse也会启动出错,配置文件打开的时候会提示警告。

 

别的问题我没遇到,就写到这里!

 

转载于:https://www.cnblogs.com/shiyangxt/archive/2009/03/06/1404926.html

展开阅读全文
博主设置当前文章不允许评论。

JBPM 4 启动流程实例错误

04-24

我在学习jbpm 4,发布了流程,流程发布的deploymentid为40001,然后我又用这个deploymentid去启动一个流程实例,ProcessInstance processInstance = executionService.startProcessInstanceById(deploymentId),但是后台报错:rnrn信息: exception while executing command org.jbpm.pvm.internal.cmd.StartProcessInstanceCmd@b9b67brnorg.jbpm.api.JbpmException: no process definition with id '40001'rn at org.jbpm.pvm.internal.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:55)rn at org.jbpm.pvm.internal.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:37)rn at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)rn at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:50)rn at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)rn at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)rn at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56)rn at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)rn at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.startProcessInstanceById(ExecutionServiceImpl.java:59)rn at com.horinoa.bpm.process.instance.ProcessInstanceUtil.start(ProcessInstanceUtil.java:50)rn at org.apache.jsp.core.form.qingjia_fill_jsp._jspService(qingjia_fill_jsp.java:80)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:416)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Thread.java:619)rn2013-4-24 18:19:49 org.jbpm.internal.log.Jdk14Log debugrn良好: ----- rolling back hibernate tx 8081111 -----------------------------------------------------rn18:19:49,379 [http-8080-1] ERROR ProcessInstanceUtil : 流程实例启动失败!错误信息为:no process definition with id '40001' 论坛

jbpm 建表时的hibernate错误

07-18

11:59:07,687 [main] INFO SettingsFactory : Deleted entity synthetic identifier rollback: disabledrn11:59:07,687 [main] INFO SettingsFactory : Default entity-mode: pojorn11:59:07,703 [main] INFO SessionFactoryImpl : building session factoryrn11:59:07,828 [main] DEBUG JbpmContext : closing JbpmContextrnorg.hibernate.HibernateException: Could not instantiate cache implementationrn at org.hibernate.cache.CacheFactory.createCache(CacheFactory.java:64)rn at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:214)rn at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)rn at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:90)rn at org.jbpm.persistence.db.DbPersistenceServiceFactory.createSchema(DbPersistenceServiceFactory.java:108)rn at org.jbpm.JbpmConfiguration.createSchema(JbpmConfiguration.java:415)rn at org.jbpm.JbpmConfiguration.createSchema(JbpmConfiguration.java:407)rn at TestHelloWorldProcess.main(TestHelloWorldProcess.java:16)rnCaused by: org.hibernate.cache.NoCachingEnabledException: Second-level cache is not enabled for usage [hibernate.cache.use_second_level_cache | hibernate.cache.use_query_cache]rn at org.hibernate.cache.NoCacheProvider.buildCache(NoCacheProvider.java:21)rn at org.hibernate.cache.CacheFactory.createCache(CacheFactory.java:61)rn ... 7 morernrn只在main方法中写两句话rnJbpmConfiguration jbpmConfiguration=JbpmConfiguration.getInstance();rnjbpmConfiguration.createSchema();rnrnrn运行后,表建出来了,但出现了上面的错误! 论坛

没有更多推荐了,返回首页