Error creating bean with name 'Test_flow': Cannot create inner bean '(inner bean)

Pramod Raut picture Pramod Raut · Jan 16, 2017 · Viewed 8.2k times · Source

I have created simple Test Suit for Test_flow but when I try to run that flow I am getting error.

java.lang.RuntimeException: org.mule.api.config.ConfigurationException: Error creating bean with name 'Test_flow': Cannot create inner bean '(inner bean)#6a12c7a8' of type [com.mulesoft.module.batch.BatchInputBlock] while setting bean property 'inputBlock'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#6a12c7a8': Cannot create inner bean '(inner bean)#1d408060' of type [org.mule.config.spring.factories.PollingMessageSourceFactoryBean] while setting bean property 'messageSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#1d408060': Cannot create inner bean '(inner bean)#1a500561' of type [com.sungardas.osstools.modules.servicenowrest.generated.processors.SysHistorySetQueryAllValuesMessageProcessor] while setting bean property 'messageProcessor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#1a500561': Cannot resolve reference to bean 'ServiceNowREST__Default_Configuration' while setting bean property 'moduleObject'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'ServiceNowREST__Default_Configuration' is defined (org.mule.api.lifecycle.InitialisationException)

    at org.mule.munit.runner.mule.SuiteRunner.<init>(SuiteRunner.java:59)
    at org.mule.munit.runner.mule.SuiteRunner.<init>(SuiteRunner.java:45)
    at org.mule.munit.remote.RemoteRunner.runTestSuite(RemoteRunner.java:75)
    at org.mule.munit.remote.RemoteRunner.run(RemoteRunner.java:55)
    at org.mule.munit.remote.RemoteRunner.main(RemoteRunner.java:39)

Steps I Performed:

  1. Using Munit Test Suit wizard created basic test suit for Test_flow and sub flows
  2. Not added anything in that test suit (i.e. mocks , variable, assert conditions)
  3. Run the basic test suit and every timing I am getting that error

I am using Anypoint studio 6.2 EE version with 3.8.3 mule runtime.

Answer

JoostD picture JoostD · Feb 2, 2017

Did you import your XML configuration files in your test suite?

Example:

<spring:beans>
    <spring:import resource="classpath:property-test-config.xml"/>
    <spring:import resource="classpath:mock-config-connectors.xml"/>
    <spring:import resource="classpath:contactUpdates-config.xml"/>
</spring:beans>