couldn't find process definition 'helloworld'
wuxi7227001 Nov 5, 2008 11:57 PMHello,everyone
Im a JBPM newbie, I want to set up a project struts2+springmodule jbpm+hibernate+oracle and run a jbpm helloworld. my configuration is as below:
applicationContext.xml:
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" lazy-init="false"> <property name="locations"> <list> <value>classpath*:conf/jdbc.properties</value> <value>classpath*:hibernate.properties</value> </list> </property> </bean> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="${jdbc.driverClassName}" /> <property name="url" value="${jdbc.url}" /> <property name="username" value="${jdbc.username}" /> <property name="password" value="${jdbc.password}" /> </bean> <!--Hibernate SessionFatory--> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="mappingDirectoryLocations"> <list> <value>classpath*:/com/indexerstudio/webapp/plugins/security/domain/hbm/</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">${hibernate.dialect}</prop> <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> <prop key="hibernate.use_sql_comments">true</prop> <prop key="hibernate.connection.useUnicode">true</prop> <prop key="hibernate.connection.defaultNChar">true</prop> <prop key="hibernate.connection.characterEncoding">UTF-8</prop> <prop key="hibernate.jdbc.use_streams_for_binary">true</prop> <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop> <prop key="hibernate.cache.provider_class">${hibernate.cache.provider_class}</prop> </props> </property> </bean> <!--Hibernate TransactionManager--> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <!-- helper for reading jBPM process definitions --> <bean id="helloworld" class="org.springmodules.workflow.jbpm31.definition.ProcessDefinitionFactoryBean"> <property name="definitionLocation" value="classpath:helloworld/processdefinition.xml" /> </bean> <!-- jBPM configuration --> <bean id="jbpmConfiguration" class="org.springmodules.workflow.jbpm31.LocalJbpmConfigurationFactoryBean"> <property name="sessionFactory" ref="sessionFactory" /> <property name="configuration" value="classpath:jbpm.cfg.xml" /> <property name="processDefinitions"> <list> <ref local="helloworld" /> </list> </property> <!-- property name="createSchema" value="true" / --> <!-- property name="processDefinitionsResources"> <list> <value>classpath:/org/springmodules/workflow/jbpm31/someOtherWorkflow.xml</value> </list> </property --> </bean> <!-- jBPM template --> <bean id="jbpmTemplate" class="org.springmodules.workflow.jbpm31.JbpmTemplate"> <constructor-arg index="0" ref="jbpmConfiguration" /> <constructor-arg index="1" ref="helloworld" /> </bean> <!-- EhCache Manager --> <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"> <property name="configLocation"> <value>classpath:conf/ehcache.xml</value> </property> </bean>
jbpm.cfg.xml:
<jbpm-configuration> <jbpm-context> <service name="persistence" factory="org.jbpm.persistence.db.DbPersistenceServiceFactory"/> <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"/> <service name="tx" factory="org.jbpm.tx.TxServiceFactory"/> </jbpm-context> <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"/> <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"/> <long name="jbpm.msg.wait.timout" value="5000" singleton="true"/> </jbpm-configuration>
I get error as below when app startup :
org.jbpm.JbpmException: couldn't find process definition 'helloworld'
at org.jbpm.db.GraphSession.findLatestProcessDefinition(GraphSession.java:158)
at org.jbpm.db.GraphSession.deployProcessDefinition(GraphSession.java:67)
at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:173)
why does it queries the database for the latest version of a process definition with the given name? why not use xml file? thanks a lot!