users@glassfish.java.net

Re: Problem in loading .so libraries in glassfish v2

From: Alexis Moussine-Pouchkine <alexis.mp_at_sun.com>
Date: Mon, 08 Oct 2007 17:39:42 +0200

you should probably start by using the Native Library Path
Prefix or Suffix setting for the JVM running GlassFish
(JVM Classpath Settings page in the web admin).
-Alexis

Saloustros Georgios wrote:
> Hello,
> I am developing a web service using glassfish v2-Eclipse 3.3(Europa) on
> SUSE Linux 9.3
> I have wrapped some fortan code which makes some numerical computations
> in order to use it through java.
> The wrapped fortan code is called correctly through a simple java
> program(checked).
> The problem is that i want to use this wrapped code inside the web
> service body.
> The wraped fortan code is .so library tha must be loaded dynamically to
> the glassfish.
> I have done the following
>
> @javax.jws.WebService
> public class MyWebService {
> static {
> try {
> Runtime.getRuntime().load("/home/.../fortran_library.so")(
> Also tried System.load("fortran_library.so") copying the
> libfortran_library.so in the lib directory of glassfish but didn't work
> either)
> } catch (Exception e) {
> System.out.println(e.getMessage());
> System.exit(1);
> }
> }
> @javax.jws.WebMethod
> public double myMethod(){
>
> /* use wraped fortarn code*/
> return result;
> }
>
> The main problem is when i call the web service i am getting a
> UnsatisfiedLinkError exception(Basically it seems the fortran_library.so
> is loaded but i can't use any of it's methods that's the point where i
> get an UnsatisfiedLinkError exception)
>
> What should i do?
> thanks,
> GS
>
>
>