cancel
Showing results for 
Search instead for 
Did you mean: 

Error injecting runtimeService Bean

fnoorie
Champ in-the-making
Champ in-the-making
I get the following error when I try to inject the runtimeService

Caused by: org.springframework.beans.ConversionNotSupportedException: Failed to convert property      value of type 'org.activiti.engine.impl.RuntimeServiceImpl' to required type 'org.activiti.engine.RuntimeService' for property 'runtimeService'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.activiti.engine.impl.RuntimeServiceImpl] to required type [org.activiti.engine.RuntimeService] for property 'runtimeService': no matching editors or conversion strategy found
    at org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:485) [spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
    at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:516) [spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
    at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:510) [spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1406) [spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1365) [spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118) [spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517) [spring-beans-3.1.1.RELEASE.jar:3.1.1.RELEASE]
    … 19 more
6 REPLIES 6

fnoorie
Champ in-the-making
Champ in-the-making
I tried a bunch of ways to inject the bean: via @Autowired, @resource, as a property but it seems to fail for the same reason everytime

martin_grofcik
Confirmed Champ
Confirmed Champ
Could you have different activiti libs present in your classpath?\\

If not:
Could you create jUnit test to reproduce this issue?

Regards
Martin

fnoorie
Champ in-the-making
Champ in-the-making
Here are the activiti jars I am using:
<code>
<dependency>
    <groupId>org.activiti</groupId>
    <artifactId>activiti-engine</artifactId>
    <version>5.16.3</version>
    <exclusions>
    <exclusion>
     <artifactId>spring-beans</artifactId>
     <groupId>org.springframework</groupId>
    </exclusion>
   
   </exclusions>
   </dependency>
   <dependency>
    <groupId>org.activiti</groupId>
    <artifactId>activiti-spring</artifactId>
    <version>5.16.3</version>
    <exclusions>
    <exclusion>
     <artifactId>spring-context</artifactId>
     <groupId>org.springframework</groupId>
    </exclusion>
    <exclusion>
     <artifactId>spring-jdbc</artifactId>
     <groupId>org.springframework</groupId>
    </exclusion>
    <exclusion>
     <artifactId>spring-orm</artifactId>
     <groupId>org.springframework</groupId>
    </exclusion>
    <exclusion>
     <artifactId>spring-core</artifactId>
     <groupId>org.springframework</groupId>
    </exclusion>
    <exclusion>
     <artifactId>spring-test</artifactId>
     <groupId>org.springframework</groupId>
    </exclusion>
    <exclusion>
     <artifactId>spring-tx</artifactId>
     <groupId>org.springframework</groupId>
    </exclusion>
    </exclusions>
   </dependency>

</code>

fnoorie
Champ in-the-making
Champ in-the-making
I tried with Junit and it works, not sure how to proceed now.

fnoorie
Champ in-the-making
Champ in-the-making
I tried even the get bean way:

ProcessEngine processEngine = (ProcessEngine) ApplicationContextProvider.getContext().getBean("processEngine");

I get a ClassCastException

martin_grofcik
Confirmed Champ
Confirmed Champ
I guess classloader has access to 2 different implementations. Check classpath.

Regards
Martin