1 Reply Latest reply on Jan 16, 2008 12:07 PM by Vitaly Xaoc

    please give good tutorial for building and deploying process

    Vitaly Xaoc Newbie

      Hello!
      I've tried to build war with jbpm, but I was stopped on deploypar process. maybe I do something wrong, it because of missing good (and full) tutorial with steps for duilding and depoying jbpm. UserGuide and articles on jboss wiki misse a lot of very important questions.
      To deploy par I've used this ant target:

      <target name="deploy.processes" description="deploys the jbpm processes">
       <taskdef name="deploypar" classname="org.jbpm.ant.DeployProcessTask">
       <classpath refid="classpath"/>
       </taskdef>
       <deploypar process="${build.dir}/simple.par"/>
       </target>


      But during deploying process archive I've got exception:
      [deploypar] 20:01:45,423 [main] INFO SessionFactoryImpl : building session factory
      [deploypar] 20:01:48,393 [main] INFO SessionFactoryObjectFactory : Not binding factory to JNDI, no JNDI name configured
      [deploypar] 20:01:48,408 [main] INFO NamingHelper : JNDI InitialContext properties:{}
      [deploypar] 20:01:48,408 [main] DEBUG JbpmContext : closing JbpmContext
      [deploypar] 20:01:48,408 [main] DEBUG Services : closing service 'persistence': org.jbpm.persistence.db.DbPersistenceService@
      8deb8a
      [deploypar] org.hibernate.HibernateException: Could not locate TransactionManager
      [deploypar] at org.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.
      java:26)
      [deploypar] at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:325)
      [deploypar] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1291)
      [deploypar] at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:91)

      [deploypar] at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:94)
      [deploypar] at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:98)
      [deploypar] at org.jbpm.persistence.db.DbPersistenceService.getGraphSession(DbPersistenceService.java:334)
      [deploypar] at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:571)
      [deploypar] at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:173)
      [deploypar] at org.jbpm.ant.DeployProcessTask.deploy(DeployProcessTask.java:93)
      [deploypar] at org.jbpm.ant.DeployProcessTask.execute(DeployProcessTask.java:58)
      [deploypar] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
      [deploypar] at org.apache.tools.ant.Task.perform(Task.java:364)
      [deploypar] at org.apache.tools.ant.Target.execute(Target.java:341)
      [deploypar] at org.apache.tools.ant.Target.performTasks(Target.java:369)
      [deploypar] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
      [deploypar] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:37)
      [deploypar] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
      [deploypar] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:382)
      [deploypar] at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:107)
      [deploypar] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
      [deploypar] at org.apache.tools.ant.Task.perform(Task.java:364)
      [deploypar] at org.apache.tools.ant.Target.execute(Target.java:341)
      [deploypar] at org.apache.tools.ant.Target.performTasks(Target.java:369)
      [deploypar] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
      [deploypar] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
      [deploypar] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
      [deploypar] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
      [deploypar] at org.apache.tools.ant.Main.runBuild(Main.java:668)
      [deploypar] at org.apache.tools.ant.Main.startAnt(Main.java:187)
      [deploypar] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
      [deploypar] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
      [deploypar] Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property,
      or as an applet parameter, or in an application resource file: java.naming.factory.initial
      [deploypar] at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
      [deploypar] at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:247)
      [deploypar] at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:284)
      [deploypar] at javax.naming.InitialContext.lookup(InitialContext.java:351)
      [deploypar] at org.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.
      java:23)
      [deploypar] ... 31 more

      BUILD FAILED
      C:\VTS\jbpm\build.xml:255: The following error occurred while executing this line:
      C:\VTS\jbpm\build.xml:303: couldn't deploy process archives : Could not locate TransactionManager

      This is my hibernate.cfg.xml part:
      <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
      <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
      <property name="hibernate.connection.url">jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}jbpmDB</property>
      <property name="hibernate.connection.username">sa</property>
      <property name="hibernate.connection.password"></property>
      <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
      
      <property name="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property>
      <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>


      This my jbpm settings:
      <jbpm-configuration>
      <jbpm-context>
      <service name="persistence">
       <factory>
       <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
       <field name="isCurrentSessionEnabled">
       <true/>
       </field>
       <field name="isTransactionEnabled">
       <false/>
       </field>
       </bean>
       </factory>
       </service>
       <service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" />
       <service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
       <service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
       <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
       </jbpm-context>
      
       <string name="resource.hibernate.cfg.xml" value="hibernate.cfg.xml" />
      
       <string name="resource.business.calendar" value="org/jbpm/calendar/jbpm.business.calendar.properties" />
       <string name="resource.default.modules" value="org/jbpm/graph/def/jbpm.default.modules.properties" />
       <string name="resource.converter" value="org/jbpm/db/hibernate/jbpm.converter.properties" />
       <string name="resource.action.types" value="org/jbpm/graph/action/action.types.xml" />
       <string name="resource.node.types" value="org/jbpm/graph/node/node.types.xml" />
       <string name="resource.parsers" value="org/jbpm/jpdl/par/jbpm.parsers.xml" />
       <string name="resource.varmapping" value="org/jbpm/context/exe/jbpm.varmapping.xml" />
       <string name="resource.mail.templates" value="jbpm.mail.templates.xml" />
      
       <int name="jbpm.byte.block.size" value="1024" singleton="true" />
       <bean name="jbpm.task.instance.factory" class="org.jbpm.taskmgmt.impl.DefaultTaskInstanceFactoryImpl" singleton="true" />
       <bean name="jbpm.variable.resolver" class="org.jbpm.jpdl.el.impl.JbpmVariableResolver" singleton="true" />
       <null name="jbpm.job.executor" />
      
      </jbpm-configuration>