IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
  • 1.  Problem while running java program on Linux

    Posted 08/09/17 03:16 AM

    Originally posted by: RamRohilla


    Hi All,

    We are running below examples with Java on Windows. But when running on Linux getting segmentation fault

    On Windows

    import com.ibm.websphere.dtx.dtxpi.MAdapter;
    import com.ibm.websphere.dtx.dtxpi.MCard;
    import com.ibm.websphere.dtx.dtxpi.MConstants;
    import com.ibm.websphere.dtx.dtxpi.MMap;
    import com.ibm.websphere.dtx.dtxpi.MStream;
    import com.ibm.websphere.dtx.dtxpi.MException;
    
    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);
    
    // Load a map
    MMap map =
    new MMap("C:\\Users\\603852686\\Documents\\ALP Data\\Non-Tandem\\WTX Linux Error\\test5.mmc");
    
    // Get the adapter object handle for input card #1
    MCard card = map.getInputCardObject(1);
    
    // 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();
    
    // Send a single large page
    stream.write(
    szInputBuffer.getBytes(), 0, szInputBuffer.length());
    
    // Get the adapter object handle for output card #2
    card = map.getOutputCardObject(2);
    
    // Override the adapter in output card #2 to be a stream
    card.overrideAdapter(
    null, MConstants.MPI_ADAPTYPE_STREAM);
    
    // 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 + ")");
    
    // 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();
    }
    }
    }
    

     

    On Windows output is



    Map status: Map completed successfully (0)

    This is my input data

    But when running on Linux, it gives un handled exceptions

     

    Unhandled exception
    Type=Segmentation error vmState=0x00000000
    J9Generic_Signal_Number=00000004 Signal_Number=0000000b Error_Value=00000000 Signal_Code=00000001
    Handler1=00007F1520249CB0 Handler2=00007F151B9B3970 InaccessibleAddress=0000000000000000
    RDI=0000000000648500 RSI=0000000000000020 RAX=0000000000000000 RBX=0000000000648500
    RCX=0000000000648598 RDX=0000000000000000 R8=0000000000000000 R9=0101010101010101
    R10=00007F152110BA50 R11=00007F15219A6150 R12=00007F151059240A R13=00007F15105919AF
    R14=0000000000000000 R15=0000000000000000
    RIP=00007F1520251757 GS=0000 FS=0000 RSP=00007F152110C4A0
    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 41462cc400000000 (f: 0.000000, d: 2.906504e+06)
    xmm9 bfd4e356872f8380 (f: 2268038144.000000, d: -3.263756e-01)
    xmm10 3ff0000000000000 (f: 0.000000, d: 1.000000e+00)
    xmm11 bedc400000000000 (f: 0.000000, d: -6.735325e-06)
    xmm12 3cc6000000000000 (f: 0.000000, d: 6.106227e-16)
    xmm13 bc59800000000000 (f: 0.000000, d: -5.529431e-18)
    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=00007F15201CE000
    Target=2_80_20170209_336038 (Linux 3.8.13-98.7.1.el7uek.x86_64)
    CPU=amd64 (1 logical CPUs) (0x1e3127000 RAM)
    ----------- Stack Backtrace -----------
    (0x00007F1520251757 [libj9vm28.so+0x83757])
    _ZN7JNIEnv_11GetMethodIDEP7_jclassPKcS3_+0x40 (0x00007F151057706A [libdtxjpi.so+0x2506a])
    _ZN8CMpiBase25_EnsureJavaInstanceExistsEv+0x134 (0x00007F151056F3C8 [libdtxjpi.so+0x1d3c8])
    _ZN8CMpiBase15GetJavaInstanceEv+0x3e (0x00007F151056F086 [libdtxjpi.so+0x1d086])
    Java_com_ibm_websphere_dtx_dtxpi_MMap_getInputCardObject+0xd6 (0x00007F151057C1A0 [libdtxjpi.so+0x2a1a0])
    (0x00007F15202617EC [libj9vm28.so+0x937ec])
    ---------------------------------------
    JVMDUMP039I Processing dump event "gpf", detail "" at 2017/08/09 07:56:05 - please wait.
    JVMDUMP032I JVM requested System dump using '/home/kumarr/maptest/core.20170809.075605.27040.0001.dmp' in response to an event
    JVMPORT030W /proc/sys/kernel/core_pattern setting "|/usr/libexec/abrt-hook-ccpp %s %c %p %u %g %t e %P %I" specifies that the core dump is to be piped to an external program.  Attempting to rename either core or core.27057.

    ^[[A^CJVMDUMP012E Error in System dump: The core file created by child process with pid = 27057 was not found. Expected to find core file with name "/home/kumarr/maptest/core.27057"
    JVMDUMP032I JVM requested Java dump using '/home/kumarr/maptest/javacore.20170809.075605.27040.0002.txt' in response to an event
    JVMDUMP010I Java dump written to /home/kumarr/maptest/javacore.20170809.075605.27040.0002.txt
    JVMDUMP032I JVM requested Snap dump using '/home/kumarr/maptest/Snap.20170809.075605.27040.0003.trc' in response to an event
    JVMDUMP010I Snap dump written to /home/kumarr/maptest/Snap.20170809.075605.27040.0003.trc
    JVMDUMP007I JVM Requesting JIT dump using '/home/kumarr/maptest/jitdump.20170809.075605.27040.0004.dmp'
    JVMDUMP010I JIT dump written to /home/kumarr/maptest/jitdump.20170809.075605.27040.0004.dmp
    JVMDUMP013I Processed dump event "gpf", detail "".

     


    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 2.  Re: Problem while running java program on Linux

    Posted 08/09/17 03:52 AM

    Originally posted by: abhishek7969


    I guess

    // Load a map

    MMap map =

    new MMap("C:\\Users\\603852686\\Documents\\ALP Data\\Non-Tandem\\WTX Linux Error\\test5.mmc");

     

    .mmc will not work u need to generate  .lnx

     

            mapSource1.compileAllMaps(MSConstants.PLATFORM.LINUX);

     


    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender


  • 3.  Re: Problem while running java program on Linux

    Posted 08/09/17 04:25 AM

    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


  • 4.  Re: Problem while running java program on Linux

    Posted 08/17/17 10:43 AM

    Originally posted by: PaulBrettIBM


    "It's crashing when unloading Java.  The library 'libdstxpi.so' needs to be preloaded.  A fix will be available as bin/envsetup update, but in the meantime, as a workaround, try executing this command after running the 'setup' script:

    export LD_PRELOAD=$LD_PRELOAD:libdstxpi.so

    ...and then the crash should not occur

    Thank-you.

    Paul

    Follow me on Twitter


    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender