• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help needed regarding Accessing JNI through JSP

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi to all
Actually i have an JAVA code in which i have called an VC++ DLL using JNI. And this program is working OK as an individual source code. But when i call this JAVA program from JSP it give an runtime error of UnsatisfiedLinkError for an VC++ DLL function "mainp()".
I have set the class path to the dir in which DLL is presen.
Here is the code of JAVA program which implements JNI:

public class test4{
public native void mainp(double loan, double roi, int tenure);

static { System.loadLibrary("repayment_new"); }

public void value(int process,double l, double r, int t) {
double loan =l;
double roi =r;
int tenure =t;
System.out.println("Process ID: " +process);

new test4().mainp(loan,roi,tenure);
}
}

where repayment_new is an DLL which is present in c:\repayment_new\debug\
and the "test4.java" is present in
"c:\tomcat5\webapps\jsp-examples\WEB-INF\repay"
where repay is an package.
I will be highly greatfull to u if you provide the solution.
U can mail the solution to me on : vineet.bharadwaj@gmail.com
With regards
Vineet Bhardwaj
India[EMAIL]vineet.bharadwaj@gmail.com
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
CLASSPATH doesn't affect how JNI locates native libraries - the native code has to be in the existing PATH, or you have to specify it using the java.library.path command line property.

Moving to the "Other Java APIs" forum, as this question isn't directly about JSPs...
 
reply
    Bookmark Topic Watch Topic
  • New Topic