Originally posted by: RamRohilla
Hi Abhishek,
I comipled map on Linux. see below program
Please note that I am using RHEL 7.2 and installed IBM WTX Launcger 9.0.0.2.
Program runs fine till system output 2 and then give unhandled exception. I think exception is coming at statement MCard card = map.getInputCardObject(1);
public class Example5
{
private static String szInputBuffer = "This is my input data";
public static void main(String[] args)
{
try
{
// Initialize the API
MMap.initializeAPI(null);
System.out.println("1");
// Load a map linuX.lnx
//MMap map = new MMap("test5.mmc");
MMap map = new MMap("linuX.lnx");
System.out.println("2");
// Get the adapter object handle for input card #1
MCard card = map.getInputCardObject(1);
System.out.println("3");
// Override the adapter in input card #1 to be a stream
card.overrideAdapter(null, MConstants.MPI_ADAPTYPE_STREAM);
// Get the handle to the stream object
MAdapter adapter = card.getAdapter();
MStream stream = adapter.getOutputStream();
System.out.println("4");
// Send a single large page
stream.write(szInputBuffer.getBytes(), 0, szInputBuffer.length());
// Get the adapter object handle for output card #2
card = map.getOutputCardObject(5);
// Override the adapter in output card #2 to be a stream
card.overrideAdapter(null, MConstants.MPI_ADAPTYPE_STREAM);
System.out.println("6");
// Run the map
map.run();
System.out.println("7");
// 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 + ")");
// Get the adapter object handle for output card #2
adapter = card.getAdapter();
stream = adapter.getInputStream();
// Get the data in pieces from the stream
stream.seek(0, MConstants.MPI_SEEK_SET);
while( true )
{
boolean bIsEnd = stream.isEnd();
// Clean and Break
if( bIsEnd )
{
stream.setSize(0);
break;
}
byte[] page = stream.readPage();
System.out.println(new String(page));
/* DoSomethingWithData (page, page.length); */
}
// Clean up
map.unload();
MMap.terminateAPI();
}
catch( MException e )
{
e.printStackTrace();
}
}
}
Output on Linux is
=================
[kumarr@ramtest maptest]$ java -cp . Example5
1
2
Unhandled exception
Type=Segmentation error vmState=0x00000000
J9Generic_Signal_Number=00000004 Signal_Number=0000000b Error_Value=00000000 Signal_Code=00000001
Handler1=00007FA6F60F8CB0 Handler2=00007FA6F5A30970 InaccessibleAddress=0000000000000000
RDI=00000000025CA500 RSI=0000000000000020 RAX=0000000000000000 RBX=00000000025CA500
RCX=00000000025CA598 RDX=0000000000000000 R8=0000000000000000 R9=0101010101010101
R10=00007FA6F6FBAA50 R11=00007FA6F7855150 R12=00007FA6E630640A R13=00007FA6E63059AF
R14=0000000000000000 R15=0000000000000000
RIP=00007FA6F6100757 GS=0000 FS=0000 RSP=00007FA6F6FBB4A0
EFlags=0000000000210246 CS=0033 RBP=0000000000000000 ERR=0000000000000004
TRAPNO=000000000000000E OLDMASK=0000000000000000 CR2=0000000000000000
xmm0 772f6d62692f6d6f (f: 1764715904.000000, d: 1.266698e+266)
xmm1 2f6d62692f6d6f63 (f: 795701120.000000, d: 3.097763e-80)
xmm2 0000000000000000 (f: 0.000000, d: 0.000000e+00)
xmm3 0000000000000000 (f: 0.000000, d: 0.000000e+00)
xmm4 00000000ff000000 (f: 4278190080.000000, d: 2.113707e-314)
xmm5 000000000000ff00 (f: 65280.000000, d: 3.225261e-319)
xmm6 00000000ff000000 (f: 4278190080.000000, d: 2.113707e-314)
xmm7 0000000000000006 (f: 6.000000, d: 2.964394e-323)
xmm8 4146308000000000 (f: 0.000000, d: 2.908416e+06)
xmm9 bfd4ee172de01460 (f: 769660032.000000, d: -3.270319e-01)
xmm10 3ff0000000000000 (f: 0.000000, d: 1.000000e+00)
xmm11 bed4800000000000 (f: 0.000000, d: -4.887581e-06)
xmm12 3cc4000000000000 (f: 0.000000, d: 5.551115e-16)
xmm13 bc74400000000000 (f: 0.000000, d: -1.756408e-17)
xmm14 bc742a87d977dc5e (f: 3648510976.000000, d: -1.749133e-17)
xmm15 402d1cb7eea86980 (f: 4004014592.000000, d: 1.455609e+01)
Module=/home/kumarr/ibm/wsdtx/java/lib/amd64/compressedrefs/libj9vm28.so
Module_base_address=00007FA6F607D000
Target=2_80_20170209_336038 (Linux 3.8.13-98.7.1.el7uek.x86_64)
CPU=amd64 (1 logical CPUs) (0x1e3127000 RAM)
----------- Stack Backtrace -----------
(0x00007FA6F6100757 [libj9vm28.so+0x83757])
_ZN7JNIEnv_11GetMethodIDEP7_jclassPKcS3_+0x40 (0x00007FA6E62EB06A [libdtxjpi.so+0x2506a])
_ZN8CMpiBase25_EnsureJavaInstanceExistsEv+0x134 (0x00007FA6E62E33C8 [libdtxjpi.so+0x1d3c8])
_ZN8CMpiBase15GetJavaInstanceEv+0x3e (0x00007FA6E62E3086 [libdtxjpi.so+0x1d086])
Java_com_ibm_websphere_dtx_dtxpi_MMap_getInputCardObject+0xd6 (0x00007FA6E62F01A0 [libdtxjpi.so+0x2a1a0])
(0x00007FA6F61107EC [libj9vm28.so+0x937ec])
#DataExchange#IBMSterlingTransformationExtender#IBM-Websphere-Transformation-Extender