0

I'm developing a Web Service using Java, through Eclipse, Version : Luna Service Release 2(4.4.2).

Now I need to access some methods which defined in some .dll files, I use System.load to reference the .dll files, like

 System.load(currentPath + "\\myLib.dll");  

My question is, I've put all my .dll files in the correct folder, but when I invoke the method, these exception will appear :

The exception contained within MappableContainerException could not be mapped to a response, re-throwing to the HTTP container
java.lang.UnsatisfiedLinkError: 
...

and

Servlet.service() for servlet [jersey-serlvet] in context with path [/FVSService] threw exception [java.lang.UnsatisfiedLinkError: com.gorilla.SmartCityService.tasks.IODSearcher.searchIODBatchEventNative([BILjava/util/Date;Ljava/util/Date;I[Lcom/gorilla/SmartCityService/tasks/IODSearcher$LABColor;[FI[BIIIII[Lcom/gorilla/SmartCityService/tasks/IODSearcher$IODBatchEvent;I)I] with root cause
java.lang.UnsatisfiedLinkError:
...

I've searched dozens of articles here and other sites, but few information are really useful to me. I tried change the paths to absolute rather then relative, or put the .dll files in the [JRE]/bin, but the question still exist.

My Java Servlet container is Jetty. Any suggestions will be appreciate!

Alanight
  • 353
  • 2
  • 8
  • 23
  • The System.load() can only be used to load the file by absolute path. Based on the error, it shows that the JVM cannot find an appropriate native-language definition of a method declared native. Therefore, to Solve this issue, firstly, ensure the path is correct, secondly, the native method is exist in the file. hope this can help you – Eric Oct 06 '16 at 03:21
  • Check this out - http://stackoverflow.com/questions/1403788/java-lang-unsatisfiedlinkerror-no-dll-in-java-library-path – Atul Kumar Oct 06 '16 at 03:28
  • @Eric I used absolute path to load the library, and also I'm sure that the method which will be invoked is in the file. Still appreciate your recomment! – Alanight Oct 06 '16 at 04:00

0 Answers0