Topic
13 replies Latest Post - ‏2013-09-01T12:43:50Z by Narasimha725
SAGARGUPTA
SAGARGUPTA
6 Posts
ACCEPTED ANSWER

Pinned topic JAVA method execution from OO COBOL

‏2013-05-16T09:43:54Z |

Hi

I am trying to exeecute a JAVA method from OO COBOL program, but when i am executing the program i am getting libjvm.so not found error, i am using following JCL:

 

//GO EXEC PGM=TSTHELLO,                                        
//         PARM='/ENVAR("_CEE_ENVFILE=/u/e189436/javacob/env") 
//             POSIX(ON)',REGION=0M                            
//STEPLIB  DD DSN=CEE.SCEERUN,DISP=SHR                         
//         DD DSN=*.LKED.SYSLMOD,DISP=SHR                      
//         DD DSN=CEE.SCEERUN2,DISP=SHR                        
//SYSOUT   DD SYSOUT=*                                         
//CEEDUMP  DD SYSOUT=*                                         
//SYSUDUMP DD DUMMY                                            
//JAVAOUT  DD PATH='/u/e189436/javacob',                       
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),                           
// PATHMODE=(SIRUSR,SIWUSR,SIRGRP)              

 

And i am getting error:The module libjvm.so was not found.
Kindly help me in this regards             
  • Tom.Ross
    Tom.Ross
    16 Posts
    ACCEPTED ANSWER

    Re: JAVA method execution from OO COBOL

    ‏2013-05-16T18:05:23Z  in response to SAGARGUPTA

    My recommendation is to get everything working with Java invoking a Java method, and then replace the invoked Java method with a COBOL method.  This way you can get help for the Java parts from Java experts and not confuse them with introducing COBOL into the mix.  Also, Java has restrictions about where and when it can be run, you can discover those more easily with pure Java.  Once you get the Java to Java working, it should be very easy to replace the invoked Java with COBOL.

    Tom

    • SAGARGUPTA
      SAGARGUPTA
      6 Posts
      ACCEPTED ANSWER

      Re: JAVA method execution from OO COBOL

      ‏2013-05-17T14:11:51Z  in response to Tom.Ross

      Hi

      My JAVA code is running fine, but when i am submitting the above JCL i am getting libjvm.so not found.

  • BillWoodger
    BillWoodger
    98 Posts
    ACCEPTED ANSWER

    Re: JAVA method execution from OO COBOL

    ‏2013-05-18T08:29:20Z  in response to SAGARGUPTA

    Is "/u/e189436/javacob" correct for your system?

    • SAGARGUPTA
      SAGARGUPTA
      6 Posts
      ACCEPTED ANSWER

      Re: JAVA method execution from OO COBOL

      ‏2013-05-20T13:41:37Z  in response to BillWoodger

      Hi

      The path and other settings are fine int the system, the problem is when i am trying to call a JAVA method i am getting libjvm.so not found.

      • BillWoodger
        BillWoodger
        98 Posts
        ACCEPTED ANSWER

        Re: JAVA method execution from OO COBOL

        ‏2013-05-20T15:17:56Z  in response to SAGARGUPTA

        OK, I suspect the problem is somewhere there ("not found" usually means we haven't provided the place to "find" it).

        Can you provide the full message, including the "code bit" at the front, please?

        • SAGARGUPTA
          SAGARGUPTA
          6 Posts
          ACCEPTED ANSWER

          Re: JAVA method execution from OO COBOL

          ‏2013-05-21T14:17:54Z  in response to BillWoodger

          Hi

          Thanks for response i am getting exactly:

           

          The module libjvm.so was not found.                                    
          From entry point GetJVMPtr at compile unit offset +000000B8 at entry offset +000000B8 at address 160E3618.
  • brataj
    brataj
    40 Posts
    ACCEPTED ANSWER

    libjvm.so was not found -> in LIBPATH

    ‏2013-05-22T13:21:21Z  in response to SAGARGUPTA

    A "libjvm.so was not found" usually means that your LIBPATH environment variable is not set up correctly; the LIBPATH is used to look up DLLs (.so files). See for example http://publibfp.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/igy3pg50/2.3.2.2

    Note that documentation aside, having the PATH point to .../java/bin is bogus, in this context, the java command is NOT used to start the JVM.

    You'll also need xplink(on) in addition to posix(on).

  • brataj
    brataj
    40 Posts
    ACCEPTED ANSWER

    Re: JAVA method execution from OO COBOL

    ‏2013-05-22T14:12:14Z  in response to SAGARGUPTA

    and I intended to mention that /etc/profile and ~/.profile will not be run, so don't expect any of those settings to be available.

    • SAGARGUPTA
      SAGARGUPTA
      6 Posts
      ACCEPTED ANSWER

      Re: JAVA method execution from OO COBOL

      ‏2013-05-22T15:39:38Z  in response to brataj

      Hi brataj

      Thanks for your response, now when i am executing this, i was getting:

      A call was made from a NOXPLINK-compiled application  to an XPLINK-compiled exported function in DLL libjvm.so and the XPLINK(ON) runtime option was not specified.  

      So to rectify it i have mentioned XPLINK(ON) in GO EXEC step in-spite of POSIX(ON), but after that i am now getting

      FAILED - SYSTEM ERROR IN INITIATOR

      Kindly help me in this regards...

      • brataj
        brataj
        40 Posts
        ACCEPTED ANSWER

        Re: JAVA method execution from OO COBOL

        ‏2013-05-22T16:50:47Z  in response to SAGARGUPTA

        I did say that you need XPLINK(ON) in addition to POSIX(ON) -- they control different aspects of the run-time initialization.

        "SYSTEM ERROR IN INITIATOR" suggests something has gone badly wrong with the address space in which your batch job is running. There will presumeably be abend codes prior to that message that will need to be investigated.

        Bernie

        • SAGARGUPTA
          SAGARGUPTA
          6 Posts
          ACCEPTED ANSWER

          Re: JAVA method execution from OO COBOL

          ‏2013-05-27T04:56:45Z  in response to brataj

          Hi 

          I solved the Initiator issue, but now i am getting a different error "TSTHELLO is not executable".

          • brataj
            brataj
            40 Posts
            ACCEPTED ANSWER

            Re: JAVA method execution from OO COBOL

            ‏2013-05-28T12:17:10Z  in response to SAGARGUPTA

            You'll need to look at your LKED step to see what errors caused the TSTHELLO module to be marked not executable.

            Since you previously got as far as "libjvm.so not found", it must be some newly introduced error.

  • Narasimha725
    Narasimha725
    1 Post
    ACCEPTED ANSWER

    Re: JAVA method execution from OO COBOL

    ‏2013-09-01T12:43:50Z  in response to SAGARGUPTA

    Hi Sagar,

    Is your issue resolved ?

    if not , can you show me the OO code as well as the contents of the ENV variable. I too had issues in executing the OO COBOL through JCL, but i found some bugs in the OO Cobol code. So, share us the code or do you want the code which is working fine for me ?

     

    Thanks