We are using STAF in our automation project (in JAVA) which uses JSTAF libraries (JSTAF.jar ) for some automation piece which inturn uses and calls the APIs in JSTAF.dll (JNI calls). Now the situation arises that when we remove / unplug the JSTAF once our automation completes (with our webapplication still running) and the next time when we try to relaunch / retry the test which uses JSTAF.jar inturn, it throws error :
registerSTAF(module name): 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
Do we have any mechanism through which we can unload the JSTAF.dll (without shutting of the webapplication / staf either). If so, please share the same.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
We are using STAF in our automation project (in JAVA) which uses JSTAF libraries (JSTAF.jar ) for some automation piece which inturn uses and calls the APIs in JSTAF.dll (JNI calls). Now the situation arises that when we remove / unplug the JSTAF once our automation completes (with our webapplication still running) and the next time when we try to relaunch / retry the test which uses JSTAF.jar inturn, it throws error :
registerSTAF(module name): 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
Do we have any mechanism through which we can unload the JSTAF.dll (without shutting of the webapplication / staf either). If so, please share the same.
Could try some of the suggested solutions described in:
- ".dll already loaded in another classloader?" at http://stackoverflow.com/questions/1030792/dll-already-loaded-in-another-classloader
- "I'm encountering classloader problems when using JNI under Tomcat" at http://wiki.apache.org/tomcat/HowTo#I.27m_encountering_classloader_problems_when_using_JNI_under_Tomcat
- "any way to make sure WAS unloads the dll used by application after application stops?" at https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000013915232