user3703423
user3703423

Reputation: 1

Mule - separating sub-flows into their own flow files

We have a Mule flow which consists of multiple sub-flows - in order to manage this better we'd like to copy the sub flows to their own individual files. At run time I get the following error I am trying to figure out.

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ParentFlow': Cannot create inner bean '(inner bean)' of type [org.mule.config.spring.factories.ScatterGatherRouterFactoryBean] while setting bean property 'messageProcessors' with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot create inner bean '(inner bean)' of type [org.mule.config.spring.factories.FlowRefFactoryBean] while setting bean property 'messageProcessors' with key [1]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Invocation of init method failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'childflow' is defined
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:282)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:126)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:353)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:154)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1391)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1132)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:522)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:626)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
at org.mule.config.spring.SpringRegistry.doInitialise(SpringRegistry.java:86)
at org.mule.registry.AbstractRegistry.initialise(AbstractRegistry.java:105)
... 20 more

This is the config:

<flow name="ParentFlow" doc:name="ParentFlow">
    <flow-ref name="childFlow" doc:name="childFlow" />
</flow>
<sub-flow name="childflow" doc:name="childflow">
</sub-flow>

Upvotes: 0

Views: 1991

Answers (2)

user1760178
user1760178

Reputation: 6647

From the config you have provided it can be seen that the name of the ChildFlow is not spelt correctly (case).

The name of the subflow is "childflow" whereas the name being referred is "childFlow"

Use the correct name "childflow" in the flow ref and it should solve it.

Upvotes: 1

Borja Coalla
Borja Coalla

Reputation: 218

Can you show your code? maybe sub-flow isn't referenced correctly or is pointing to an undefined subflow.

Upvotes: 0

Related Questions