cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Library for Native Hostid Couldn't Be Loaded (-521,7024)

Library for Native Hostid Couldn't Be Loaded (-521,7024)

Summary

Customer meets ?Library for Native Hostid Couldn't Be Loaded (-521,7024)? when running BasciExample in Java toolkit after enabling native hostid under Linux

Question

Customer meets ?Library for Native Hostid Couldn't Be Loaded (-521,7024)? when running BasciExample in Java toolkit after enabling native hostid under Linux

# java BasicExample f4 1.0 license.lic
Exception in thread "main" java.lang.RuntimeException: Library for Native Hostid Couldn't Be Loaded (-521,7024)
at BasicExample.getVendorInfo(BasicExample.java:115)
at BasicExample.main(BasicExample.java:59)

Answer

1. Under Linux, check if path which contains liblmgr11.so is added into LD_LIBRARY_PATH
# echo $
LD_LIBRARY_PATH

2. Verify if you are using same version of JDK as FNP C toolkit.
- If you are using 32-bit FNP C toolkit, make sure you installed 32-bit JDK
- If
you are using 62-bit FNP C toolkit, make sure you installed 62-bit JDK

Additional Information

If you decompile flexlm.jar and open following source code
"C:\Program Files (x86)\FNP\FlexNet Licensing Toolkit for Java 11.12.0.0\java\flexlm\com\macrovision\flexlm\VendorInfo.class"
you should be able to find the exception is thrown by Java API System.loadLibrary(str2);
http://docs.oracle.com/javase/7/docs/api/java/lang/System.html#loadLibrary(java.lang.String)

I did some test and find the System.loadLibrary searchs liblmgr11.so in paths set into LD_LIBRARY_PATH.

------------
[root@RHEL6 examples]# echo $LD_LIBRARY_PATH
/fnp_11.12/java/examples
[root@RHEL6 examples]# mv liblmgr11.so liblmgr11.so.a
[root@RHEL6 examples]# java BasicExample f2 1.0 uncounted-eth.lic
Exception in thread "main" java.lang.RuntimeException: Library for Native Hostid Couldn't Be Loaded (-521,7024)
at BasicExample.getVendorInfo(BasicExample.java:115)
at BasicExample.main(BasicExample.java:59)

[root@RHEL6 examples]# export LD_LIBRARY_PATH=/fnp_11.12/x64_lsb
[root@RHEL6 examples]# java BasicExample f2 1.0 uncounted-eth.lic
f2 checked out (VS: null)
Hit return to check in:

[root@RHEL6 examples]# export LD_LIBRARY_PATH=
[root@RHEL6 examples]# java BasicExample f2 1.0 uncounted-eth.lic
Exception in thread "main" java.lang.RuntimeException: Library for Native Hostid Couldn't Be Loaded (-521,7024)
at BasicExample.getVendorInfo(BasicExample.java:115)
at BasicExample.main(BasicExample.java:59)

[root@RHEL6 examples]# export LD_LIBRARY_PATH=/fnp_11.12/x64_lsb/liblmgr11.so
[root@RHEL6 examples]# java BasicExample f2 1.0 uncounted-eth.lic
Exception in thread "main" java.lang.RuntimeException: Library for Native Hostid Couldn't Be Loaded (-521,7024)
at BasicExample.getVendorInfo(BasicExample.java:115)
at BasicExample.main(BasicExample.java:59)

[root@RHEL6 examples]# export LD_LIBRARY_PATH=/fnp_11.12/x64_lsb
[root@RHEL6 examples]# java BasicExample f2 1.0 uncounted-eth.lic
f2 checked out (VS: null)
Hit return to check in:
------------
Labels (1)
Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Nov 15, 2018 05:16 PM
Updated by: