How to fix java.lang.UnsatisfiedLinkError: com.mapr.fs.jni.MapRClient.init?

Document created by wade on Feb 27, 2016
Version 1Show Document
  • View in full screen mode

Author: Venkata Sowriraja, last modified by Hassan Shaik

Original Publication Date: April 21, 2015

 

Environment:

  • MapR Client 4.0.1 or 4.0.2

Symptoms:

  • Below error messages are shown in console

java.lang.UnsatisfiedLinkError: com.mapr.fs.jni.MapRClient.init(ILjava/lang/String;ZZILcom/mapr/fs/jni/MapRConstants$JniUsername;IIIIIII)I

com.mapr.fs.jni.MapRClient.init(Native Method)

com.mapr.fs.MapRFileSystem.initConfig(MapRFileSystem.java:397)

com.mapr.fs.MapRFileSystem.initialize(MapRFileSystem.java:295)

org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2433)

org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:91)

org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2467)

org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2449)

org.apache.hadoop.fs.FileSystem.get(FileSystem.java:404)

org.apache.hadoop.fs.FileSystem.get(FileSystem.java:169)

com.cisco.cstg.HadoopConnector.doGet(HadoopConnector.java:74)

javax.servlet.http.HttpServlet.service(HttpServlet.java:620)

javax.servlet.http.HttpServlet.service(HttpServlet.java:727)

org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

 

Root Cause:

  • If it is a Web application or standalone application, trying to use MapR client artifacts v4.0.1 or v4.0.2, then no need to pass this argument-Djava.library.path="C:\opt\mapr\lib". If the MapR client installed is 4.0.1 and the application uses maprfs-*-4.0.2.jar artifacts (or vice versa), then this error would come. Since there is no signature for MapRClient.init() in MapR 4.0.1, wrong use of MapR v4.0.2 artifacts tries to access the init() and fails with the above stack trace.

Solutions:

  • In general, it is recommended to not use "-Djava.library.path="C:\opt\mapr\lib" args, as all the native libraries are already shipped with the MapR artifacts. Unless otherwise it is really needed for including any other libraries during run time.
  • It is also recommended to be consistent with the use of MapR Client and MapR artifacts (used in pom.xml as dependencies of application) used in the application. For eg: Do not use MapR 4.0.2 client as MapR 4.0.1 artifacts in the application.

 

 

 

1 person found this helpful

Attachments

    Outcomes