Topic
  • No replies
SAGARGUPTA
SAGARGUPTA
6 Posts

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
    21 Posts

    Re: JAVA method execution from OO COBOL

    ‏2013-05-16T18:05:23Z  

    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

    Re: JAVA method execution from OO COBOL

    ‏2013-05-17T14:11:51Z  
    • Tom.Ross
    • ‏2013-05-16T18:05:23Z

    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

    Hi

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

  • BillWoodger
    BillWoodger
    134 Posts

    Re: JAVA method execution from OO COBOL

    ‏2013-05-18T08:29:20Z  

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

  • SAGARGUPTA
    SAGARGUPTA
    6 Posts

    Re: JAVA method execution from OO COBOL

    ‏2013-05-20T13:41:37Z  

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

    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
    134 Posts

    Re: JAVA method execution from OO COBOL

    ‏2013-05-20T15:17:56Z  

    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.

    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

    Re: JAVA method execution from OO COBOL

    ‏2013-05-21T14:17:54Z  

    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?

    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

    libjvm.so was not found -> in LIBPATH

    ‏2013-05-22T13:21:21Z  

    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

    Re: JAVA method execution from OO COBOL

    ‏2013-05-22T14:12:14Z  

    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

    Re: JAVA method execution from OO COBOL

    ‏2013-05-22T15:39:38Z  
    • brataj
    • ‏2013-05-22T14:12:14Z

    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.

    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

    Re: JAVA method execution from OO COBOL

    ‏2013-05-22T16:50:47Z  

    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...

    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

    Re: JAVA method execution from OO COBOL

    ‏2013-05-27T04:56:45Z  
    • brataj
    • ‏2013-05-22T16:50:47Z

    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

    Hi 

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

  • brataj
    brataj
    40 Posts

    Re: JAVA method execution from OO COBOL

    ‏2013-05-28T12:17:10Z  

    Hi 

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

    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

    Re: JAVA method execution from OO COBOL

    ‏2013-09-01T12:43:50Z  

    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