Originally posted by: SanjayPanchal
code import com.ibm.websphere.dtx.dtxpi.MConstants;
import com.ibm.websphere.dtx.dtxpi.MException;
import com.ibm.websphere.dtx.dtxpi.MMap;
public class Example1
{
public static void main(String[] args)
{
try
{
runMap();
runMap();
}
catch( Exception e )
{
e.printStackTrace();
}
}
private static void runMap() throws MException {
// Initialize the API
MMap.initializeAPI(null);
// Create a map
MMap map = new MMap("data/map/ns1ns2.mmc");
// Run the map
map.run();
// Check the return status
int iRC = map.getIntegerProperty(MConstants.MPIP_OBJECT_ERROR_CODE, 0);
String szMsg = map.getTextProperty(MConstants.MPIP_OBJECT_ERROR_MSG, 0);
System.out.println("Map status: " + szMsg + " (" + iRC + ")");
// Clean up
map.unload();
MMap.terminateAPI();
}
}
[/code]
I tried the above code with test1.mmc given in example. It works fine but when i try it with the custom mmc created it fails with below output.
code Map status: Source not available (12)
com.ibm.websphere.dtx.dtxpi.MException: Loading map failed - Native function: CMpiMapSet::CMpiMapSet
at com.ibm.websphere.dtx.dtxpi.MMap._init(Native Method)
at com.ibm.websphere.dtx.dtxpi.MMap.<init>(Unknown Source)
at Example1.runMap(Example1.java:37)
at Example1.main(Example1.java:24)
[/code]
The strange thing is the first call to runMap is sucessfull while the second throws an exception.
Can somebody throw some light on this?
I am attaching the mms.
Sanjay
#DataExchange#IBM-Websphere-Transformation-Extender#IBMSterlingTransformationExtender