用activiti5.20.0版本,
spring注入的processEngine突然就不好使了,原来只注入到一个service里面,现在又写了个service,相当于注入到两个地方,但是我取消注入新的service,还是不行,莫名其妙,项目启动不了,
报错
Caused by: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'processEngine' is expected to be of type 'org.activiti.spring.ProcessEngineFactoryBean' but was actually of type 'org.activiti.engine.impl.ProcessEngineImpl'
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:378)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.autowireResource(CommonAnnotationBeanPostProcessor.java:522)
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.getResource(CommonAnnotationBeanPostProcessor.java:496)
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor$ResourceElement.getResourceToInject(CommonAnnotationBeanPostProcessor.java:627)
at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:169)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:318)
... 39 more
最后我把byName的方式改成了byType,就好使了