Menu

How to load and Unload STAF.dll from JAVA

Help
2016-10-14
2016-10-21
  • Ganesh Markande

    Ganesh Markande - 2016-10-14

    Hi,

    I am using STAF to integrate client side automation. I am using JAVA as a internal framework.
    My requirement is to load and unload STAF.dll(As i need to load and unload native methods from JAVA) from JAVA instead of using System.loadLibrary().(Which is the default implementation in STAF to load the library). Can you please suggest is there a way to load dll.

     
  • Sharon Lucas

    Sharon Lucas - 2016-10-14

    I'm not sure I understand what you are asking. Sounds like you've looked at the STAF source code to see how its implemented.

     
  • Ganesh Markande

    Ganesh Markande - 2016-10-21

    Sorry for the confusion,

    I am using STAF.. I could see that JSTAF.jar is taking care of loading its native library(JSTAF.dll) under STAFHandle.class file(Its a static block ).. But STAF does not take care of unloading its narive library. This is casuing my Automation scripts failure with error

    Failures:
    * registerSTAF(com.isg.epo.staf.test): Native Library C:\STAF\bin\JSTAF.dll already loaded in another classloader
    java.lang.UnsatisfiedLinkError: Native Library C:\STAF\bin\JSTAF.dll already loaded in another classloader

     
  • Ganesh Markande

    Ganesh Markande - 2016-10-21

    Few points to note :-
    I need a DLL-handle to unload any native library. Since STAF.jar takes care of loading its dll, i wont get the dll-handle name which i can use it to unload...

    My question is, since STAF take care of loading its native libraries, why cant STAF takes care of unloading it during unregistering of JSTAF.jar.

     

Log in to post a comment.