单独用跑的时候没有问题,在action中用的时候会有如下错误:
无法将 NULL 值插入列 'VERSION_',表 'jbpm.dbo.JBPM_TASKINSTANCE';该列不允许空值。INSERT 失败。

解决方案 »

  1.   

    我的jbpm没出现过你这样的错,JBPM_TASKINSTANCE是jbpm的自带表,里面的数据也是你发布流程时自动生成的  该是你发布流程时出的问题吧?
      

  2.   

    流程应该没问题,因为单独作为应用程序跑的时候没有这个问题,可以存入数据库15:57:12,578 [http-8080-1] DEBUG JDBCExceptionReporter : Could not execute JDBC batch update [insert into JBPM_TASKINSTANCE (NAME_, DESCRIPTION_, ACTORID_, CREATE_, START_, END_, DUEDATE_, PRIORITY_, ISCANCELLED_, ISSUSPENDED_, ISOPEN_, ISSIGNALLING_, ISBLOCKING_, TASK_, TOKEN_, SWIMLANINSTANCE_, TASKMGMTINSTANCE_, CLASS_, ID_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'T', ?)]
    java.sql.BatchUpdateException: ORA-01400: cannot insert NULL into ("TEST2"."JBPM_TASKINSTANCE"."VERSION_")
      

  3.   

    16:18:44,015 [http-8080-1] ERROR JDBCExceptionReporter : ORA-01400: cannot insert NULL into ("TEST2"."JBPM_TASKINSTANCE"."VERSION_")16:18:44,015 [http-8080-1] ERROR JDBCExceptionReporter : ORA-01400: cannot insert NULL into ("TEST2"."JBPM_TASKINSTANCE"."VERSION_")org.jbpm.persistence.JbpmPersistenceException: couldn't commit hibernate session
    at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:172)
    at org.jbpm.svc.Services.close(Services.java:211)
    at org.jbpm.JbpmContext.close(JbpmContext.java:139)
    at com.sany.struts.action.FirstFlowProcessDBTest.createProcessInstance(FirstFlowProcessDBTest.java:77)
    at com.sany.struts.action.FirstFlowProcessDBTest.test7000YuanApplication(FirstFlowProcessDBTest.java:45)
    at com.sany.struts.action.JbpmTestAction.submitapp(JbpmTestAction.java:40)
    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 org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
    at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
    at java.lang.Thread.run(Unknown Source)
    Caused by: org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
    at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253)
    at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:92)
    at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:87)
    at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:222)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2224)
    at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2660)
    at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:52)
    at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
    at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
    at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
    at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
    at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
    at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
    at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
    at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
    at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:162)
    ... 29 more
    Caused by: java.sql.BatchUpdateException: ORA-01400: cannot insert NULL into ("TEST2"."JBPM_TASKINSTANCE"."VERSION_") at oracle.jdbc.dbaccess.DBError.throwBatchUpdateException(DBError.java:459)
    at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:3907)
    at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
    at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
    ... 44 more
      

  4.   

    15:57:12,578 [http-8080-1] DEBUG JDBCExceptionReporter : Could not execute JDBC batch update [insert into JBPM_TASKINSTANCE (NAME_, DESCRIPTION_, ACTORID_, CREATE_, START_, END_, DUEDATE_, PRIORITY_, ISCANCELLED_, ISSUSPENDED_, ISOPEN_, ISSIGNALLING_, ISBLOCKING_, TASK_, TOKEN_, SWIMLANINSTANCE_, TASKMGMTINSTANCE_, CLASS_, ID_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'T', ?)] 
    从这一句看很奇怪啊,插入的时候就没有VERSION_字段,为什么会没有呢...
      

  5.   

    既然流程能顺利发布成功,就不是jbpm持久化问题了吧 呵呵at com.sany.struts.action.FirstFlowProcessDBTest.createProcessInstance(FirstFlowProcessDBTest.java:77)
    at com.sany.struts.action.FirstFlowProcessDBTest.test7000YuanApplication(FirstFlowProcessDBTest.java:45)
    at com.sany.struts.action.JbpmTestAction.submitapp(JbpmTestAction.java:40) 
     
    这几行debug一下吧,看那个地方null了
      

  6.   

    这一行:jbpmContext.close(); 
      

  7.   


    恩,我也看到了,你是怎么创建JBPM_TASKINSTANCE这个表的?
      

  8.   

    主要是放action里面有就不行了,觉得很奇怪
    public class JbpmTestAction extends DispatchAction { public ActionForward submitapp(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response) {
    FirstFlowProcessDBTest test = new FirstFlowProcessDBTest(); 
    test.test7000YuanApplication();
    return mapping.findForward("success");
    }
    同一个包下的另一个文件可以运行:
    public class test { public static void main(String[] args) {
    // TODO Auto-generated method stub
    FirstFlowProcessDBTest test = new FirstFlowProcessDBTest(); 
    test.test7000YuanApplication();
    }}
      

  9.   

    数据库脚本与LIB库不匹配,lib里面少插不能为空"not null"字段。