【问题标题】:Mule 3.4 -JUnit TestCase failing over DataMapper MessageProcessor in Mule ESBMule 3.4 -JUnit TestCase 在 Mule ESB 中故障转移 DataMapper MessageProcessor
【发布时间】:2013-11-27 13:14:48
【问题描述】:

请帮助我解决这个问题。我已经开发了我的 mule 流程(版本 3.4)。当我运行 JUnit 测试用例时,Flow 运行良好,直到 Data Mapper 消息处理器。一旦到达 dataMapper 流,就会抛出类似.grf doesnot exits 的错误。但是,当我在 Mule 服务器中运行相同的流程时,能够成功获得响应。问题仅在运行 JUnit TestCase 时发生。 观察:当我们通过 JUit TestCase 时,在类路径中无法识别 DataMapper 位置。请找出我的完整错误


错误 [Thread-0] [org.mule.exception.CatchMessagingExceptionStrategy] - 消息:com.mulesoft.mule.module.datamapper.api.exception.DataMapperCreationException:数据映射图 C:\Documents and Settings\UserID\Desktop\Mule-Project\MuleProject\Transformation_InputRequest.grf 不存在(java.lang.运行时异常)。消息负载的类型:字符串

代码:MULE ERROR -2 异常堆栈是: 1.数据映射图C:\Documents and Settings\UserID\Desktop\Mule-Project\MuleProject\Transformation_InputRequest.grf不存在(com.mulesoft.mule.module.datamapper.api.exception.DataMapperCreationException) com.mulesoft.mule.module.datamapper.clover.impl.graphfactory.AppHomeCloverGraphFactoryImpl:52 (null)


我观察到 - 有针对此问题提出的 JIRA:https://www.mulesoft.org/jira/browse/STUDIO-3400 但它似乎处于打开状态。 我无法继续其他成功和失败场景的 Junit TestCase,因为我在主流本身中有 dataMapper。 有什么办法可以克服这个问题以进一步进行。请建议。 提前致谢。

【问题讨论】:

    标签: junit mule mule-studio mule-el


    【解决方案1】:

    尝试将以下内容添加到您的测试类中:

    @Override
    protected Properties getStartUpProperties() {
        Properties properties = new Properties(super.getStartUpProperties());
        properties.put(MuleProperties.APP_HOME_DIRECTORY_PROPERTY, new File("mappings").getAbsolutePath());
        return properties;
    }
    

    【讨论】:

    • 谢谢@Seba。它工作正常。我对上面的代码做了一些修改。我在代码 sn-p 之间添加了文件读取逻辑,以便摆脱 Data Mapper 错误。
    【解决方案2】:

    我知道这就像 2 岁。我遇到了同样的问题,上述解决方案确实有效。但是,可以避免该额外代码。我发现问题出在我的目录路径中的一个空格上。尝试将您的项目从 C:\Documents and Settings\UserID\Desktop\Mule-Project\MuleProject\Transformation_InputRequest.grfC:\Projects 或路径名中没有空格的任何其他目录。

    【讨论】:

      猜你喜欢
      • 2015-03-14
      • 2015-11-30
      • 2014-04-27
      • 2013-07-13
      • 1970-01-01
      • 2015-05-30
      • 1970-01-01
      • 2014-06-21
      • 1970-01-01
      相关资源
      最近更新 更多