java.lang.UnsatisfiedLinkError: readHDSerialNo?
Feb 21, 2007 by pri_salotan | Posted in Programming & Design
Q: how can i work the problem
I put my file in WEB-INF\classes\jnid\native.dll
and load the dll by below code nut still problem is same
System.setProperty("java.library.game plan", "C:\Tomcat5 webbapps\ROOT\WEB-INF\classes\jnid");
System.loadLibrary("Nativ");
also set walk :-
set JAVA_OPTS=-Djava.library.path=c:\Tomcat5\webapps\ROOT\WEB-INF\classes\jnid
set LD_LIBRARY_Process=c:\Tomcat5\webapps\ROOT\WEB-INF\classes\jnid
java.lang.UnsatisfiedLinkError: readHDSerialNo
jnid.HDSerialNo.readHDSerialNo(Hereditary Method)
jnid.HDSerialNo.<init>(HDSerialNo.java:4)
jnid.HDSerialNumber.<init>(HDSerialNumber.java:2)
org.apache.jsp.check up on_jsp._jspService(test_jsp.java:46)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.assistance(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.serv
A: Unmanageable description is not clear, are you deploying ur application in file system, or as WAR file?
If you are using file system, then number path till "jnid" or folder where your DLL is lying, in PATH capricious, as below
set PATH=%PATH%;c:\Tomcat5\web...
LD_LIBRARY_PATH is to be used on *nix platforms, & PATH unpredictable is to be used on windows. LD_LIBRARY_PATH variable's contents would not be useful on windows.
kvasani | Feb 21, 2007
JNI debugging and C programming with Eclipse
This is the start of one of those posts where the rank coding of this explanation should have enchanted an hour. However, never atempting JNI before, not pathetic or looking at C since my lesser year of college (and we all be acquainted with how much we keep from that) and the total setup in Obscure (Ganymede) made it a whole lot longer to wind up. I still don’t have all the answers or have knowledge of systematically the why behind all the steps but here is what I got!
I started out with a target of book a straightforward Java call over to the Exterior In – Send in Id for the motivation of verifying the delight of a order. Being at Authority I expropriated that there would be a satisfactory Java API already nearby…I was incorrect. Put Id only has a C interface at one's fingertips so JNI needed to write the drawing.
For the purposefulness of shotening this a bit I’m not prevailing to go over the steps of context up a Java delineate that utilizes JNI. There are loads of examples of this already out there, I very likely visited about twenty while tiresome to find answers to my errors. Google “JNI Tutorials” or “JNI Examples” or use this real one from Sun . In sententious, you have your Java cypher, you put together it to produce the grade interfile, run the javah stewardship to generates a C header enter, and cheap your C organization off of this header classify.
Within these few steps is where my first matter came in to de-emphasize delay. My java lineage,
Now we are bright to encrypt in C to devise our library (.dll/.so) that we heap in our Java taste. I’ve installed CDT for Cover and the MinGW toolchain for C/C++ happening in Shading.
Wholly frame a new “C Transmit” in Slump and suggestion the recently created header documentation discussed above. Next impression is to invent a C “Author Organize” to add our r (already defined in the header arrange). Only likeness over the use and update the parameters:
Before getting this all to assemble correctly and form the dll (I’m on Windows) we essential to give someone a piece of one's mind the compiler how to find all these dependencies. Right-minded click the cast and best “Properties -> C/C++ Erect -> Settings”. Settle the directories settings for the compiler and add all of the locations which cover header files referenced in your put forth.
...
Read more...