cancel
Showing results for 
Search instead for 
Did you mean: 

Datasource on StandaloneProcessEngineConfiguration

edsonrichter
Confirmed Champ
Confirmed Champ
I must be doing something really stupid… but I can't figure out without help.
Using Activiti 5.20.0. Running Tomcat 8.0.33. Without spring.
All required JAR files are on server lib folder (double checked).

Error I'm getting:


"(org.springframework.beans.factory.BeanCreationException) org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngineConfiguration' defined in resource loaded through InputStream: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'dataSource' of bean class [org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration]: 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?"

My activiti.cfg.xml:


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans   http://www.springframework.org/schema/beans/spring-beans.xsd">

  <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName" value="java:comp/env/jdbc/activiti"/>
  </bean>
  <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">
    <property name="dataSource" ref="dataSource" />
  </bean>
</beans>

Please, help.

Thanks,

Edson Richter
5 REPLIES 5

edsonrichter
Confirmed Champ
Confirmed Champ
There is a biazed XML declaration on top, but it has been caused by the forum app, the xml is ok in my setup.
Problem seems spring not being able to call the setDataSource method in StandaloneProcessEngineConfiguration.

edsonrichter
Confirmed Champ
Confirmed Champ
One problem found: I had two different versions of Spring .jar files in ${catalina_home}/lib and ${catalina_home}/shared/lib

(and yes, my tomcat is configured to read shared folder - which causes more trouble than good, and this is one good example why the shared folder has been deprecated in Tomcat recent releases).

edsonrichter
Confirmed Champ
Confirmed Champ
+1 I had to add "spring-context" and "commons-lang3"

edsonrichter
Confirmed Champ
Confirmed Champ
Ok, to answer my own question. So far, so good.
These are the JAR files I had to add in my setup (until now):
activiti-bpmn-converter-5.20.0.jar
activiti-bpmn-layout-5.20.0.jar
activiti-bpmn-model-5.20.0.jar
activiti-camel-5.20.0.jar
activiti-cdi.jar
activiti-common-rest-5.20.0.jar
activiti-crystalball-5.20.0.jar
activiti-cxf-5.20.0.jar
activiti-diagram-rest-5.20.0.jar
activiti-engine-5.20.0.jar
activiti-explorer-5.20.0.jar
activiti-image-generator-5.20.0.jar
activiti-jmx-5.20.0.jar
activiti-json-converter-5.20.0.jar
activiti-ldap-5.20.0.jar
activiti-modeler-5.20.0.jar
activiti-mule-5.20.0.jar
activiti-osgi-5.20.0.jar
activiti-process-validation-5.20.0.jar
activiti-rest-5.20.0.jar
activiti-simple-workflow-5.20.0.jar
activiti-spring-5.20.0.jar
groovy-all-2.4.5.jar
jackson-annotations-2.2.3.jar
jackson-core-2.2.3.jar
jackson-databind-2.2.3.jar
jcl-over-slf4j-1.7.6.jar
joda-time-2.6.jar
mybatis-3.3.0.jar
slf4j-api-1.7.6.jar
slf4j-log4j12-1.7.6.jar
spring-aop-4.1.5.RELEASE.jar
spring-beans-4.1.5.RELEASE.jar
spring-context-4.1.5.RELEASE.jar
spring-core-4.1.5.RELEASE.jar
commons-lang3-3.3.2.jar

But my server has other JAR files needed by the application itself (like the PostgreSQL JDBC driver, other "apache commons" libraries, and so on). So, may be this list of JAR files is incomplete - these are the ones I'd add to the existing list.

Also, I've reviewed all JAR files just to be sure I've no conflicting versions (ex: spring.jar from a very old reporting library was conflicting recent Spring jar files).

This kind of "jar" conflicts causes errors like "method xyz requires java.lang.String, not the received value of type [java.lang.String]" (!!!) or "property dataSource is not writable or data type is different" and so on.


edsonrichter
Confirmed Champ
Confirmed Champ
Of course, needed to create the tables in my database (I've choosen to not use auto update).