Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Ambari views java.lang.UnsatisfiedLinkError on loading native libraries ...

Highlighted

Ambari views java.lang.UnsatisfiedLinkError on loading native libraries ...

New Contributor

Hi, We are trying to integrate our HCFS implementation with HDP. Our file system implementation uses native library (say /usr/lib/jni/myfs.so). The native library is loaded in a static block (once per class loader) through java filesystem class MyfsFileSystem.java. For Ambari views to access our file system implementation jar (MyfsFileSystem.jar) we copied it at below locations:

/var/lib/ambari-server/resources/views/work/FILES{1.0.0}/WEB-INF/lib/MyfsFileSystem.jar

/var/lib/ambari-server/resources/views/work/HIVE{1.5.0}/WEB-INF/lib/MyfsFileSystem.jar

So here is the problem, When I click on File view UI the operation succeeds, internally the class-loader loads the MyfsFileSystem.jar and the myfs.so library gets successfully loaded, but when I click on the hive view it fails to load the library and throws server error with exception java.lang.UnsatisfiedLinkError in ambari logs. As per our understanding, for every web app a class-loader exists and it tries to load the library. When the library is loaded through one of the ambari views (in above case File views), the other class-loader (say for hive view) fails to load the library. To solve this problem, we want our native library be loaded once for all views/webapps. Is there a way to load library only once for all ambari views (webapps) ? In tomcat this is achievable by placing the jar in $CATALINA_HOME/lib, but how can we do the same for ambari.

Don't have an account?
Coming from Hortonworks? Activate your account here