cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti 5.9 with Spring 1.2.9 possible?

cookie-exploit
Champ in-the-making
Champ in-the-making
Hello Guys,

is it possible to use Activiti with Spring 1.2.9? If it is not possible, which is the lowest spring version i need?
If I use Spring 1.2.9 I've a problem with the SpringProcessEngineConfiguration and the dataSource property.

applicationContext.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<beans>

   <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
      <property name="driverClassName" value="com.mysql.jdbc.Driver" />
      <property name="url" value="jdbc:mysql://localhost:3306/activiti" />
      <property name="username" value="root" />
      <property name="password" value="root" />
   </bean>

   <bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
      <property name="dataSource" ref="dataSource" />
      <property name="transactionManager" ref="transactionManager" />
      <property name="databaseSchemaUpdate" value="true" />
      <property name="jobExecutorActivate" value="false" />
      <property name="deploymentResources" value="classpath:*/tutorial/diagram/SingleApprover.bpmn20.xml" />
   </bean>
   …
</beans>

Error Message:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngineConfiguration' defined in class path resource [applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'dataSource' of bean class [org.activiti.spring.SpringProcessEngineConfiguration]: Bean property 'dataSource' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?

Greetz cookie-exploit


EDIT: We now use Spring 3.x, problem is solved.
2 REPLIES 2

frederikherema1
Star Contributor
Star Contributor
The version activiti 5.9 uses is 3.0.5. I Presume there are older versions where it will run on, but no guarantees on that.

I think your version of spring doesn't support setters that return a value, as most of the ProcessEngineConfiguration setters are to allow chaining when used in code… So probably the first version that can cope with those, is the smallest version activiti needs for the error you have, not sure about other stuff off course.

Anyway, if you're stuck at 1.2.9, I think it's time to upgrade. Spring has a good reputation of being backwards-compatible…

cookie-exploit
Champ in-the-making
Champ in-the-making
Thanks for reply. Smiley Happy

I have done a mistake, I have copied the wrong spring.jar from our project, this was a .jar which is no longer used.
The version we actually use is 2.5.6, but with this version i have another error.

Error:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine' defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.reflect.MalformedParameterizedTypeException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at biz.myera.tecframe.bpm.test.activiti.SingleApproverTest.setUp(SingleApproverTest.java:30)
at junit.framework.TestCase.runBare(TestCase.java:125)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.reflect.MalformedParameterizedTypeException
at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.validateConstructorArguments(Unknown Source)
at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.<init>(Unknown Source)
at sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl.make(Unknown Source)
at sun.reflect.generics.factory.CoreReflectionFactory.makeParameterizedType(Unknown Source)
at sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Unknown Source)
at sun.reflect.generics.tree.ClassTypeSignature.accept(Unknown Source)
at sun.reflect.generics.repository.ClassRepository.getSuperInterfaces(Unknown Source)
at java.lang.Class.getGenericInterfaces(Unknown Source)
at org.springframework.core.GenericTypeResolver.getTypeVariableMap(GenericTypeResolver.java:154)
at org.springframework.core.GenericTypeResolver.resolveReturnType(GenericTypeResolver.java:101)
at org.springframework.beans.GenericTypeAwarePropertyDescriptor.getPropertyType(GenericTypeAwarePropertyDescriptor.java:88)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
… 27 more

If no one have a idea with this error, then I had to told the project leader, that we need Spring 3.
Have anyone an idea? Smiley Happy


Greetz cookie-exploit