【问题标题】:Error creating bean with name 'Test_flow': Cannot create inner bean '(inner bean)创建名为“Test_flow”的bean时出错:无法创建内部bean“(内部bean)
【发布时间】:2017-02-14 10:15:29
【问题描述】:

我为 Test_flow 创建了简单的测试套件,但是当我尝试运行该流程时出现错误。

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)

我执行的步骤:

  1. 使用 Munit 测试套件向导为 Test_flow 和子流创建基本测试套件
  2. 未在该测试套件中添加任何内容(即模拟、变量、断言条件)
  3. 运行基本测试套件,每次我都会遇到该错误

我正在使用带有 3.8.3 mule 运行时的 Anypoint studio 6.2 EE 版本。

【问题讨论】:

    标签: java mule-studio anypoint-studio servicenow munit


    【解决方案1】:

    您是否在测试套件中导入了 XML 配置文件?

    例子:

    <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>
    

    【讨论】:

    • 请注意他的意思是:“确保您正在导入包含名为 ServiceNowREST__Default_Configuration 的 bean 的文件” MUnit 只会在您右键单击时导入包含它们的文件,或者如果您使用向导。它不知道如何自省应用程序以导入导致此类问题的所有必要资源。
    【解决方案2】:

    从您的异常中,它指出“没有定义名为 'ServiceNowREST__Default_Configuration' 的 bean”。请检查定义了“ServiceNowREST__Default_Configuration”的 mule 配置文件是否存在于测试套件的类路径中。将文件添加到类路径将解决问题

    【讨论】:

      【解决方案3】:

      无法重现。你有一个 Maven 项目还是一个普通的 Mule 项目?如果您可以添加一些有关您的项目的其他信息,那就太好了。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2013-11-08
        • 1970-01-01
        • 1970-01-01
        • 2012-03-05
        • 2015-11-06
        • 2019-05-23
        • 1970-01-01
        相关资源
        最近更新 更多