1

kindly help me to overcome this issue. I have developed my mule flow ( version 3.4). When i run the JUnit Test case, Flow running fine till the Data Mapper message processor. Once after reaching dataMapper flow throwing the error like .grf doesnot exits. But when i run the same flow in Mule server able to get the response successfully.Problem happens only when running the JUnit TestCase. Observation: When we hit through JUit TestCase , DataMapper location is not being recognized in the classpath. Please find my complete error


ERROR [Thread-0] [org.mule.exception.CatchMessagingExceptionStrategy] - Message : com.mulesoft.mule.module.datamapper.api.exception.DataMapperCreationException: The data mapping graph C:\Documents and Settings\UserID\Desktop\Mule-Project\MuleProject\Transformation_InputRequest.grf does not exists (java.lang.RuntimeException). Message payload is of type: String

Code : MULE ERROR -2 Exception stack is: 1. The data mapping graph C:\Documents and Settings\UserID\Desktop\Mule-Project\MuleProject\Transformation_InputRequest.grf does not exists (com.mulesoft.mule.module.datamapper.api.exception.DataMapperCreationException) com.mulesoft.mule.module.datamapper.clover.impl.graphfactory.AppHomeCloverGraphFactoryImpl:52 (null)


I have observed -there is the JIRA raised for this issue:https://www.mulesoft.org/jira/browse/STUDIO-3400 but it seems to be open state. I'm not able to proceed other success and failure scenario's Junit TestCase since i have dataMapper in main flow itself. Is there any way to overcome this issue to proceed further. Kindly suggest. Thanks in advance.

star
  • 1,493
  • 1
  • 28
  • 61

2 Answers2

4

Try adding the following to your test class:

@Override
protected Properties getStartUpProperties() {
    Properties properties = new Properties(super.getStartUpProperties());
    properties.put(MuleProperties.APP_HOME_DIRECTORY_PROPERTY, new File("mappings").getAbsolutePath());
    return properties;
}
Seba
  • 2,319
  • 15
  • 14
  • Thank you @Seba. It works fine. I have done some modification in the above code. I have added file read logic in between the code snippet in order to get out from Data Mapper error. – star Nov 28 '13 at 12:39
1

I know this is like 2 years old. I had this same problem and the above solution does work. However one can avoid that extra code. I found the problem to be a space in my directory path. Try moving your project from C:\Documents and Settings\UserID\Desktop\Mule-Project\MuleProject\Transformation_InputRequest.grf to C:\Projects or any other directory with no spaces in the path name.

kparkinson
  • 48
  • 3