Results 1 to 5 of 5
  1. #1
    sunil.mact is offline Member
    Join Date
    Jan 2009
    Posts
    8
    Rep Power
    0

    Default java.lang.UnsatisfiedLinkError

    Hi,

    I am using quicktime API for image extracting.actually i have two different context in tomcat for two diffferent Applications and both have this feature so i am keeping the corresponding jar in both context/web-inf/lib folder.the problem is that when i upload video from one application then that have no issue but when upload from the second one that gives java.lang.UnsatisfiedLinkError error the java.lang.NoClassDefFoundError.or if i upload firstly from second one then no issue then upload from the first one then got the same exception.
    can anybody help me out.
    thanks in advance.

  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    Sounds like a Java class is using JNI to call a native code library. When you try to access the native code from two contexts in the same JVM, you end up with an error the second time.

    Try moving the JAR file to common/lib *and* remove it from the application directories.
    Last edited by Steve11235; 03-01-2009 at 05:44 PM. Reason: and ......

  3. #3
    sunil.mact is offline Member
    Join Date
    Jan 2009
    Posts
    8
    Rep Power
    0

    Default Thanks but still had some doubts

    Thanks and got your point but still some doubts like that kind of problem facing in very rare case if i got this exception every time then problem has resolved by what u have suggested.what should i do in this situation please help me out.

  4. #4
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    I'm not sure what you are saying. Try using very short sentences.

    First of all, did my solution stop the problem?

    What I'm hearing is that you want to know the root cause of the problem and why what I suggested might fix it.

    I'm just guessing at the solution, based on what I believe the problem might be.

    Web application servers are very complex. They load the same class multiple times if the class is placed in multiple applications' WEB-INF directory. I'm guessing that the interface between Java and the operating system will not allow the same native code to be accessed twice in the same JVM. The first application "locks" the native code. The second application attempts to do the same thing, but it can't, so you get an error.

    Putting the class in the common directory causes all *applications* to share the class. (Note that the core server component has its own code base.) However, the Web server is smart enough to load the class again it finds it in an application's WEB-INF directory. WEB-INF overrides common.

    Therefore, take the class (or its JAR) out of the every WEB-INF directory and put it in the common directory.

    Native code tends to be touchy, and it can crash the application instead of just causing an exception.

    If what I suggested doesn't work, you might want to try the following, somewhat complicated, solution.

    Create a separate server application that *only* runs the native code classes. Access this application from your Web server applications using sockets running over localhost.

  5. #5
    sunil.mact is offline Member
    Join Date
    Jan 2009
    Posts
    8
    Rep Power
    0

    Default Thanks :)

    Thanks Steve,now i got your point and also my problem has been resolved.

Similar Threads

  1. java.lang.OutOfMemoryError: Java heap space
    By paul in forum Advanced Java
    Replies: 11
    Last Post: 06-12-2010, 05:30 PM
  2. Replies: 3
    Last Post: 09-07-2009, 01:28 PM
  3. Replies: 2
    Last Post: 09-18-2008, 07:30 AM
  4. Replies: 0
    Last Post: 08-12-2007, 03:23 PM
  5. java.lang.UnsatisfiedLinkError: JAWT_GetAWT()
    By Albert in forum AWT / Swing
    Replies: 2
    Last Post: 07-01-2007, 04:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •