java.lang.UnsatisfiedLinkError: Native Library WEB-INF/lib/libfoo.so already loaded i

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jazi
    New Member
    • Jun 2007
    • 21

    java.lang.UnsatisfiedLinkError: Native Library WEB-INF/lib/libfoo.so already loaded i

    Hi,

    I have built a web servise using JNI under jboss. The JNI loads a native library
    static {
    Ststem.loadLibr ary("foo");
    }

    If I starts the jboss server then I do not have any issue however, when I tried to hot-deploy I keep getting the following error:
    java.lang.Unsat isfiedLinkError : Native Library WEB-INF/lib/libfoo.so already loaded in another classloader

    Since I hot deploy then it tries to load the same library and off course JVM will not allow such thing.

    I have read something about it online but none seems to help or hard to follow to be honest with you.
    My question has been dealt with this kind of scenario depolying ws in tomcat or jboss? Is there a way I check if it is already loaded then skip it otherwise load it. Or how do people handle such an issue.

    I appreciate any kind of tips.

    regards,
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by Jazi
    Hi,

    I have built a web servise using JNI under jboss. The JNI loads a native library
    static {
    Ststem.loadLibr ary("foo");
    }

    If I starts the jboss server then I do not have any issue however, when I tried to hot-deploy I keep getting the following error:
    java.lang.Unsat isfiedLinkError : Native Library WEB-INF/lib/libfoo.so already loaded in another classloader

    Since I hot deploy then it tries to load the same library and off course JVM will not allow such thing.

    I have read something about it online but none seems to help or hard to follow to be honest with you.
    My question has been dealt with this kind of scenario depolying ws in tomcat or jboss? Is there a way I check if it is already loaded then skip it otherwise load it. Or how do people handle such an issue.

    I appreciate any kind of tips.

    regards,
    UnsatisfiedLink does not mean that the library is already loaded. It means that the library does not exist.

    Comment

    • Jazi
      New Member
      • Jun 2007
      • 21

      #3
      Originally posted by r035198x
      UnsatisfiedLink does not mean that the library is already loaded. It means that the library does not exist.
      Thanks for the reply.
      No in this case. It means it was trying to reload the same library. Again this only happens if I redeploy the web services. If I restart jboss then there is no problem. And this is because this call is in the web application folder it tries to load it again.

      I would like to resolve this issue without restarting the server. Any idea?
      thanks

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by Jazi
        Thanks for the reply.
        No in this case. It means it was trying to reload the same library. Again this only happens if I redeploy the web services. If I restart jboss then there is no problem. And this is because this call is in the web application folder it tries to load it again.

        I would like to resolve this issue without restarting the server. Any idea?
        thanks
        Read the API documentation for that method. The library is simply not being found in the path that's being used to search for it at that moment.

        Comment

        Working...