1 Reply Latest reply on Jan 15, 2010 2:03 PM by Ronald van Kuijk

    Deploying process Definition

    Sakthivelmurugan KG Newbie

      Hi,

       

      I am  new to JBPM. I am using JBPM 3.2.3.  I am getting the following exception while creating a new process instance. I have deployed the process definition only for the first time as it is putting an entry everytime in JBPM_PROCESSDEFINITION table.

       

      org.hibernate.HibernateException: null index column for collection: org.jbpm.graph.def.ProcessDefinition.definitions

        at org.hibernate.persister.collection.AbstractCollectionPersister.readIndex(AbstractCollectionPersister.java:710)
              at org.hibernate.collection.PersistentMap.readFrom(PersistentMap.java:258)
              at org.hibernate.loader.Loader.readCollectionElement(Loader.java:1008)
              at org.hibernate.loader.Loader.readCollectionElements(Loader.java:646)
              at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:591)
              at org.hibernate.loader.Loader.doQuery(Loader.java:701)
              at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
              at org.hibernate.loader.Loader.loadCollection(Loader.java:1994)
              at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:36)
              at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:565)
              at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:60)
              at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1716)
              at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:344)
              at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
              at org.hibernate.collection.PersistentMap.values(PersistentMap.java:234)
              at org.jbpm.graph.exe.ProcessInstance.<init>(ProcessInstance.java:145)
              at org.jbpm.graph.exe.ProcessInstance.<init>(ProcessInstance.java:92)
              at in.co.nmsworks.ordermanagement.process.ProcessFlow.startProcess(ProcessFlow.java:77)
              at com.cygnet.nms.webclient.ordermgmt.action.OrderSubmitAction.addOrder(OrderSubmitAction.java:129)
              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 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.doGet(ActionServlet.java:507)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
              at com.adventnet.nms.webclient.login.AuthenticationFilter.doFilter(AuthenticationFilter.java:114)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
              at com.adventnet.nms.webclient.i18n.EncodingFilter.doFilter(EncodingFilter.java:70)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
              at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
              at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
              at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
              at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
              at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
              at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
              at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
              at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
              at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
              at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
              at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
              at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
              at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
              at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
              at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
              at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:466)
              at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:585)
              at java.lang.Thread.run(Thread.java:595)

       

       

      Here is the code i am using to get Jbpm context, Jbpmconfiguration, ProcessDefinition:

       

             JbpmConfiguration configuration = JbpmConfiguration.parseResource("jbpm.cfg.xml");
              //configuration.createSchema();
              JbpmContext context = configuration.getCurrentJbpmContext();
              if(context == null) {
                  context = configuration.createJbpmContext();
              }
              ProcessDefinition definition = null;
              GraphSession session = context.getGraphSession();
              definition = session.loadProcessDefinition(1);
              System.out.println(" Process Definition reference in JBPM Server :: " + definition);
              if(definition ==  null) {
                  definition = ProcessDefinition.parseXmlResource("processdefinition.xml");
                  context.deployProcessDefinition(definition);
              }

       

       

      Here is the code i am using to create a new process instance:


      // Code to get process definition goes here

       

       

      // Creating a process instance

      ProcessInstance instance = new ProcessInstance(definition);

       

      I am able to see the process definition reference in my logs. But not able to understand why the exception has occured and process instance is not created?

       


      Anyone please help me on this as it is very urgent

       


      Thanks in advance.

       

      Regards,

      Sakthi