Java 创建名为';测试流程';:无法创建内部bean';(内豆)

Java 创建名为';测试流程';:无法创建内部bean';(内豆),java,mule-studio,anypoint-studio,servicenow,munit,Java,Mule Studio,Anypoint Studio,Servicenow,Munit,我已经为测试流创建了简单的测试套件,但是当我尝试运行该流时,我得到了错误 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.BatchInputBloc

我已经为测试流创建了简单的测试套件,但是当我尝试运行该流时,我得到了错误

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)
java.lang.RuntimeException:org.mule.api.config.ConfigurationException:创建名为“Test_flow”的bean时出错:设置bean属性“inputBlock”时,无法创建[com.mulesoft.module.batch.BatchInputBlock]类型的内部bean(内部bean)#6a12c7a8”;嵌套异常为org.springframework.beans.factory.BeanCreationException:创建名为“(内部bean)#6a12c7a8”的bean时出错:设置bean属性“messageSource”时无法创建[org.mule.config.spring.factories.PollingMessageSourceFactoryBean]类型的内部bean“(内部bean)#1d408060”;嵌套异常为org.springframework.beans.factory.beancreatitionException:创建名为“(内部bean)#1d408060”的bean时出错:无法创建[com.sungardas.osstools.modules.servicenowrest.generated.processors.syshistorySetQuerylValuesMessageProcessor]类型的“内部bean”(内部bean)#1a500561]设置bean属性“messageProcessor”时;嵌套异常为org.springframework.beans.factory.BeanCreationException:创建名为“(内部bean)#1a500561”的bean时出错:设置bean属性“moduleObject”时无法解析对bean“ServiceNowREST_u默认_u配置”的引用;嵌套异常为org.springframework.beans.factory.NoSuchBeanDefinitionException:未定义名为“ServiceNowREST\u默认配置”的bean(org.mule.api.lifecycle.InitialisationException)
位于org.mule.munit.runner.mule.SuiteRunner。(SuiteRunner.java:59)
位于org.mule.munit.runner.mule.SuiteRunner。(SuiteRunner.java:45)
位于org.mule.munit.remote.RemoteRunner.runTestSuite(RemoteRunner.java:75)
位于org.mule.munit.remote.RemoteRunner.run(RemoteRunner.java:55)
位于org.mule.munit.remote.RemoteRunner.main(RemoteRunner.java:39)
我执行的步骤:

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

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

    无法复制它。你有Maven项目还是普通的Mule项目?如果您可以添加一些关于您的项目的附加信息,那就太好了。

    无法复制它。你有Maven项目还是普通的Mule项目?如果您可以添加一些关于您的项目的附加信息,那就太好了。

    您是否在测试套件中导入了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>
    

    您是否在测试套件中导入了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\u默认\u配置”的bean”。请检查测试套件的类路径中是否存在定义了“ServiceNowREST\u默认\u配置”的mule配置文件。将文件添加到类路径将解决异常中的问题,它声明“未定义名为“ServiceNowREST\u默认\u配置”的bean”。请检查测试套件的类路径中是否存在定义了“ServiceNowREST\u默认\u配置”的mule配置文件。将文件添加到类路径将解决此问题

    请注意,他的意思是:“确保您正在导入包含名为ServiceNowREST\u Default\u配置的bean的文件”如果您右键单击,MUnit将只导入包含它们流的文件,如果您使用向导,则只导入那些选中的文件。它不知道如何内省应用程序以导入导致此类问题的所有必要资源。请注意,他的意思是:“确保导入的文件包含名为ServiceNowREST\u默认\u配置的bean”如果您右键单击,MUnit将只导入包含它们流的文件;如果您使用向导,MUnit将只导入选定的文件。它不知道如何内省应用程序来导入所有必要的资源,这些资源导致了此类问题。