jBPM 4.3 and Spring 3
jochen_mader Feb 11, 2010 9:25 AMI got it working but I get a "Multiple Spring beans found for type interface java.util.Map returning the first one found" warning.
Tracing around I found out that WireContext is looking for "deployments". It doesn't exist in the current context so it delegates to spring. There it uses java.util.Map to search for it and gets back a list containing "systemProperties" and "systemPreferences".
Doesn't look right to me, although my processes work as expected
the call causing the warnings:
ProcessEngine engine = (ProcessEngine) context.getBean("processEngine"); engine.getRepositoryService().createDeployment().addResourceFromClasspath("processdefinitions/hello.jpdl.xml").deploy();
my jbpm config:
<jbpm-configuration> <import resource="jbpm.jpdl.cfg.xml" /> <import resource="jbpm.tx.spring.cfg.xml" /> <import resource="jbpm.default.cfg.xml" /> <import resource="jbpm.jpdl.cfg.xml" /> </jbpm-configuration>
And this spring configuration:
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <bean id="springHelper" class="org.jbpm.pvm.internal.processengine.SpringHelper" /> <bean id="processEngine" factory-bean="springHelper" factory-method="createProcessEngine" /> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="configLocation" value="classpath:jbpm.hibernate.cfg.xml" /> <property name="dataSource" ref="dataSource" /> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> <property name="dataSource" ref="dataSource" /> </bean> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="org.hsqldb.jdbcDriver" /> <property name="url" value="jdbc:hsqldb:file:testdb" /> <property name="username" value="sa" /> <property name="password" value="" /> </bean> </beans>
Messed up the syntax highlighting