5 Replies Latest reply on Oct 20, 2009 2:44 PM by Ronald van Kuijk

    [jBPM4] Programatic deployment - DEPLOYPROP table is empty

    Nassos Michas Newbie

      Hello,

      I'm trying to programmatically deploy a process definition, using:

      NewDeployment newDeployment = processEngine.getRepositoryService().createDeployment();
      newDeployment.addResourceFromString(processName, processDefinition).deploy();


      The above creates two entires in my db, in JBPM4_DEPLOYMENT and JBPM4_LOB tables (nothing else is created in any other table).

      Later on, when I try to start an instance of the above process like:
      ExecutionService executionService = processEngine.getExecutionService();
      ProcessInstance pi = executionService.startProcessInstanceById(processID);


      passing as 'processID' the value I obtained during deployment, I get:
      org.jbpm.api.JbpmException: no process definition with id '15'.
      (15 is my processID obtained during deployment).

      Checking hibernate's queries, I see that jBPM is trying to execute:
      select * from ( select deployment0_.DBID_ as DBID1_81_, deployment0_.DEPLOYMENT_ as DEPLOYMENT2_81_, deployment0_.OBJNAME_ as OBJNAME3_81_, deploym
      ent0_.KEY_ as KEY4_81_, deployment0_.STRINGVAL_ as STRINGVAL5_81_, deployment0_.LONGVAL_ as LONGVAL6_81_ from JBPM4_DEPLOYPROP deployment0_ where deployment0_.KEY_='pdid' and deployment0_.STRINGVAL_='
      15' ) where rownum <= ?


      The above query obviously fails as JBPM4_DEPLOYPROP is totally empty.

      Any ideas what I may be doing wrong?


        • 1. Re: [jBPM4] Programatic deployment - DEPLOYPROP table is emp
          Sebastian Schneider Master

          Are you sure you have obtained a process definition id during deployment and not a deployment id? Keep in mind that these are different.

          • 2. Re: [jBPM4] Programatic deployment - DEPLOYPROP table is emp
            Nassos Michas Newbie

            Sebastian,

            actually, I think I have obtained a deployment ID and not a process definition ID as you mention. However, I believe the problem lies with the unpopulated table JBPM4_DEPLOYPROP. On some stand-alone testing I'm doing, I deploy the same process and I see this table being populated OK but when trying it on my web-app only JBPM4_DEPLOYMENT and JBPM4_LOB get populated.

            • 3. Re: [jBPM4] Programatic deployment - DEPLOYPROP table is emp
              Nassos Michas Newbie

              And here's the log output in case someone has a hint:

              2009-10-20 12:18:52,379 DEBUG org.hibernate.jdbc.JDBCContext - successfully registered Synchronization
              2009-10-20 12:18:52,379 DEBUG org.hibernate.impl.SessionImpl - opened session at timestamp: 5144700241424384
              2009-10-20 12:18:52,379 DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
              2009-10-20 12:18:52,379 DEBUG org.hibernate.jdbc.ConnectionManager - opening JDBC connection
              2009-10-20 12:18:52,380 DEBUG org.hibernate.SQL - select hibernate_sequence.nextval from dual
              2009-10-20 12:18:52,381 DEBUG org.hibernate.id.SequenceGenerator - Sequence identifier generated: 103
              2009-10-20 12:18:52,381 DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
              2009-10-20 12:18:52,381 DEBUG org.hibernate.jdbc.ConnectionManager - aggressively releasing JDBC connection
              2009-10-20 12:18:52,381 DEBUG org.hibernate.jdbc.ConnectionManager - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
              2009-10-20 12:18:52,381 DEBUG org.hibernate.event.def.AbstractSaveEventListener - generated identifier: 103, using strategy: org.hibernate.id.SequenceGenerator
              2009-10-20 12:18:52,382 DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
              2009-10-20 12:18:52,382 DEBUG org.hibernate.jdbc.ConnectionManager - opening JDBC connection
              2009-10-20 12:18:52,382 DEBUG org.hibernate.SQL - select hibernate_sequence.nextval from dual
              2009-10-20 12:18:52,383 DEBUG org.hibernate.id.SequenceGenerator - Sequence identifier generated: 104
              2009-10-20 12:18:52,383 DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
              2009-10-20 12:18:52,393 DEBUG org.hibernate.jdbc.ConnectionManager - aggressively releasing JDBC connection
              2009-10-20 12:18:52,393 DEBUG org.hibernate.jdbc.ConnectionManager - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
              2009-10-20 12:18:52,393 DEBUG org.hibernate.event.def.AbstractSaveEventListener - generated identifier: 104, using strategy: org.hibernate.id.SequenceGenerator
              2009-10-20 12:18:52,394 DEBUG .hibernate.event.def.AbstractFlushingEventListener - processing flush-time cascades
              2009-10-20 12:18:52,396 DEBUG .hibernate.event.def.AbstractFlushingEventListener - dirty checking collections
              2009-10-20 12:18:52,396 DEBUG org.hibernate.engine.Collections - Collection found: [org.jbpm.pvm.internal.repository.DeploymentImpl.resources#103], was: [<unreferenced>] (initialized)
              2009-10-20 12:18:52,396 DEBUG .hibernate.event.def.AbstractFlushingEventListener - Flushed: 2 insertions, 0 updates, 0 deletions to 2 objects
              2009-10-20 12:18:52,396 DEBUG .hibernate.event.def.AbstractFlushingEventListener - Flushed: 1 (re)creations, 0 updates, 0 removals to 1 collections
              2009-10-20 12:18:52,398 DEBUG org.hibernate.pretty.Printer - listing entities:
              2009-10-20 12:18:52,398 DEBUG org.hibernate.pretty.Printer - org.jbpm.pvm.internal.lob.Lob{blob=org.hibernate.lob.SerializableBlob@139160e, dbid=104, dbversion=0}
              2009-10-20 12:18:52,398 DEBUG org.hibernate.pretty.Printer - org.jbpm.pvm.internal.repository.DeploymentImpl{timestamp=0, resources=[org.jbpm.pvm.internal.lob.Lob#104], name=null, objectProperties=nul
              l, state=active, dbid=103}
              2009-10-20 12:18:52,401 DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
              2009-10-20 12:18:52,401 DEBUG org.hibernate.jdbc.ConnectionManager - opening JDBC connection
              2009-10-20 12:18:52,401 DEBUG org.hibernate.SQL - insert into JBPM4_DEPLOYMENT (NAME_, TIMESTAMP_, STATE_, DBID_) values (?, ?, ?, ?)
              2009-10-20 12:18:52,401 DEBUG org.hibernate.jdbc.AbstractBatcher - Executing batch size: 1
              2009-10-20 12:18:52,403 DEBUG org.hibernate.jdbc.Expectations - success of batch update unknown: 0
              2009-10-20 12:18:52,403 DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
              2009-10-20 12:18:52,403 DEBUG org.hibernate.jdbc.ConnectionManager - skipping aggressive-release due to flush cycle
              2009-10-20 12:18:52,403 DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
              2009-10-20 12:18:52,403 DEBUG org.hibernate.SQL - insert into JBPM4_LOB (DBVERSION_, BLOB_VALUE_, DBID_) values (?, ?, ?)
              2009-10-20 12:18:52,404 DEBUG org.hibernate.jdbc.AbstractBatcher - Executing batch size: 1
              2009-10-20 12:18:52,407 DEBUG org.hibernate.jdbc.Expectations - success of batch update unknown: 0
              2009-10-20 12:18:52,407 DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
              2009-10-20 12:18:52,407 DEBUG org.hibernate.jdbc.ConnectionManager - skipping aggressive-release due to flush cycle
              2009-10-20 12:18:52,407 DEBUG e.persister.collection.AbstractCollectionPersister - Inserting collection: [org.jbpm.pvm.internal.repository.DeploymentImpl.resources#103]
              2009-10-20 12:18:52,407 DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
              2009-10-20 12:18:52,407 DEBUG org.hibernate.SQL - update JBPM4_LOB set DEPLOYMENT_=?, NAME_=? where DBID_=?
              2009-10-20 12:18:52,409 DEBUG e.persister.collection.AbstractCollectionPersister - done inserting collection: 1 rows inserted
              2009-10-20 12:18:52,409 DEBUG org.hibernate.jdbc.AbstractBatcher - Executing batch size: 1
              2009-10-20 12:18:52,410 DEBUG org.hibernate.jdbc.Expectations - success of batch update unknown: 0
              2009-10-20 12:18:52,410 DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
              2009-10-20 12:18:52,411 DEBUG org.hibernate.jdbc.ConnectionManager - skipping aggressive-release due to flush cycle
              2009-10-20 12:18:52,412 DEBUG org.hibernate.jdbc.ConnectionManager - aggressively releasing JDBC connection
              2009-10-20 12:18:52,412 DEBUG org.hibernate.jdbc.ConnectionManager - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
              


              • 4. Re: [jBPM4] Programatic deployment - DEPLOYPROP table is emp
                Nassos Michas Newbie

                And to reply to myself, the problem is with the 'addResourceFromString'. As a first argument you need to pass a name ending in ".jpdl.xml". After that, everything works fine.

                • 5. Re: [jBPM4] Programatic deployment - DEPLOYPROP table is emp
                  Ronald van Kuijk Master

                  There are lots of unittests for this in the source. Maybe you can have a look there and take note of the differences.