Menu

#187 [MAC OSX 10.11] staf add service fails for execute JSTAF with error : Could not load JVM

v1.0 (example)
open
None
5
2015-11-18
2015-10-29
No

Based on my research, I found that DYLD_LIBRARY_PATH is not available to JAVA process on mac 10.11.

I read some resolutions based on disabling rootless on OS X 10.11 but that is not recommended for the test scenarios that we want to execute.

Please help.

Discussion

  • Sharon Lucas

    Sharon Lucas - 2015-10-29

    When googling for information on how other applications that rely on DYLD_LIBRARY_PATH resolved this issue on OS X 10.11, it sounds like a solution is to symlink libJSTAF.dylib and libJSTAFSH.dylib to /usr/local/lib. For example, assuming STAF is installed in the default location /Library/staf:

    sudo ln -s /Library/staf/lib/libJSTAF.dylib /usr/local/lib/libJSTAF.dylib
    sudo ln -s /Library/staf/lib/libJSTAFSH.dylib /usr/local/lib/libJSTAFSH.dylib
    

    Let me know if this worked for you.

    Found this symlink to /usr/local/lib solution at
    https://blogs.nrao.edu/jmalone/2015/10/05/how-to-fix-aips-under-osx-el-capitan/ and https://forums.developer.apple.com/thread/7935.

     
  • Sharon Lucas

    Sharon Lucas - 2015-10-29
    • assigned_to: Sharon Lucas
     
  • Tushar Singhal

    Tushar Singhal - 2015-10-30

    Thanks Sharon for your prompt response. Softlink was the right solution, but still we copied all the required libraries to /usr/local/lib and it worked for STAF 3.4.23 but not for older version. We tried on MAC OSX 10.11.1

    Now with Staf 3.4.23, we are facing one issue which was not present with older version of STAF(3.4.15) that we used.

    The following command :
    staf localhost@6501 service add service MYSERVICE library stafexecproxy execute /Users/Shared/ep_test/lib/epaf/framework/native/libCUSTOMPythonService.dylib OPTION PROXYENV=PATH=/Users/Shared/ep_test/lib/prereq/python/bin:/Users/Shared/ep_test/lib/prereq/python/lib/python2.7/site-packages:$PATH OPTION PROXYENV=PYTHONHOME=/Users/Shared/ep_test/lib/prereq/python OPTION PROXYENV=PYTHONPATH=/Users/Shared/ep_test/lib/prereq/python/lib OPTION PROXYENV=DYLD_LIBRARY_PATH=/Users/Shared/ep_test/lib/prereq/boost:/Users/Shared/ep_test/lib/prereq/python:/Users/Shared/ep_test/lib/prereq/python/lib:$DYLD_LIBRARY_PATH PARMS /Users/Shared/ep_test/lib/epaf/framework/python/automation_framework/PythonHandler.py PythonHandler PREPEND /Users/Shared/ep_test/lib/prereq/STAF/lib/python27 APPEND /Users/Shared/ep_test/lib/prereq/STAF/lib /Users/Shared/ep_test/lib/epaf/framework/python /Users/Shared/ep_test/lib/epaf/command_providers/python

    fails with error RC 6 with staf 3.4.23

    Is there any change in the syntax or options for this command in 3.4.23 ? Please help.

    Will really apreciate your response on this.

     
  • Sharon Lucas

    Sharon Lucas - 2015-10-30

    No, there were no changes in the syntax or options when registering STAF services in 3.4.23.

    My guess is that this is also caused by the changes in Mac OS X 10.11 where you can no longer define DYLD_LIBRARY_PATH without disabling SIP (System Integrity Protection). You are specifying a PROXYENV option that adds additional directories to the DYLD_LIBRARY_PATH. You'll need to do the same softlink workaround (or copy the .dylib files) for any .dylib files that your service needs that are in the directories you are specifying in OPTION PROXYENV=DYLD_LIBRARY_PATH when registering your custom Python service:

    /Users/Shared/ep_test/lib/rereq/boost
    /Users/Shared/ep_test/lib/prereq/python
    /Users/Shared/ep_test/lib/prereq/python/lib

     
  • Ankit Kasat

    Ankit Kasat - 2015-11-18

    Hi Sharon,

    I ran these commands:
    sudo ln -s /Library/staf/lib/libJSTAF.dylib /usr/local/lib/libJSTAF.dylib
    sudo ln -s /Library/staf/lib/libJSTAFSH.dylib /usr/local/lib/libJSTAFSH.dylib
    But "operation not permitted" error came while executing above two lines.
    Then I disabled SIP(rootless) and ran above two commands and they sucessfully ran.
    Then I again enabled SIP and same thing happened(staf add service fails for execute JSTAF with error : Could not load JVM).

    This means even symlink doesn't work if SIP is enabled. I guess we cannot use STAF while SIP is enabled.

     

Log in to post a comment.

MongoDB Logo MongoDB