[jboss-user] [jBPM] - Unable to chain processEngine as spring bean factory

Jaber C. Mourad do-not-reply at jboss.com
Fri Apr 30 08:49:46 EDT 2010


Jaber C. Mourad [http://community.jboss.org/people/newbeewan] created the discussion

"Unable to chain processEngine as spring bean factory"

To view the discussion, visit: http://community.jboss.org/message/540404#540404

--------------------------------------------------------------
Hi,

I'm looking for a solution to create every services from processEngine directly via spring factory feature but Spring complain about circular references !

My current configuration :

<bean id="springHelper">
        <property name="jbpmCfg" value="jbpm.cfg.xml" />
    </bean>

    <bean id="processEngine" factory-bean="springHelper"
        factory-method="createProcessEngine" scope="singleton" depends-on="springHelper" />

    <bean id="repositoryService" factory-bean="processEngine"
        factory-method="getRepositoryService" scope="singleton"
        depends-on="springHelper,processEngine" />

I've got an Exception using that config :

org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.jbpm.api.RepositoryService mypackage.myBean.repositoryService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repositoryService' defined in class path resource [cfg/jbpmConfigurationTest.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.jbpm.api.RepositoryService org.jbpm.pvm.internal.processengine.ProcessEngineImpl.getRepositoryService()] threw exception; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'repositoryService': Requested bean is currently in creation: Is there an unresolvable circular reference?
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:507)
    at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)
    at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:283)
...



Is there any trick to force Spring to initiate the first factory then the processEngine, then the repositoryService and after all resolving autowired fields ?

--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/540404#540404]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100430/86d79580/attachment.html 


More information about the jboss-user mailing list