Daniel Stroe wrote:
>
> In which way I can use a function from a dll file called from a servlet.
> The problem is the I can't load the library with System.loadLibrary()
> call. I got an exception UnsatisfiedLinkError. When I use the same code
> into in a application class is all Ok.
>
> I mention that I use Jdk 1.1.6.
A class that is not on the classpath cannot call a native method.
Since the servlets dir is not in the classpath (on Jrun anyway), you
can't do this.
Jrun has a custom classloader that reloads classes if modified without
having to restart the jvm - this will break if the servlets dir is in
the classpath.
So...
The solution is to create an interface class that loads the native code,
and put IT in the classpath. Then your servlet can create an instance
of it, and use it to call native methods.
Note - that the .dll also needs to be on your classpath.
2nd Note - the system classpath and the servlet engines classpath may
not neccesarily be the same.
Alfonso.
--
------------------------------------o0o-----------------------------------
The Programmer Formerly Known as Alfonso Urdaneta Ph:
561.581.7360
Integrated Visions Fax:
561.581.7377
10315 102nd Terrace
[EMAIL PROTECTED]
Sebastian FL, 32958
http://www.integratedvisions.com
"Time flies like the wind, but fruit flies like bananas"
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html