Menu

Problem with loading native library

Anonymous
2011-09-20
2013-04-26
  • Anonymous

    Anonymous - 2011-09-20

    Hi, the latest version included the native libraries inside the jar, this made deployment a lot easier.

    However, we run outldd in applets and as it stands now, it's not possible to load the applet more than once (due to an UnsatisfiedLinkError: Native Library (…)\OutlDD.dll already loaded in another classloader. Is there an easy way to code around this issue?

    Thanks again for a great library!

     
  • wide

    wide - 2011-09-20

    Hello,
    maybe the information from a stackoverflow thread could help you:
    http://stackoverflow.com/questions/3724421/native-library-already-loaded-in-another-classloader.

    "You can do this by getting the system class loader (or the top parent of the class loader of your current class) and then dynamically have it load the class which uses the native library."

    The class to be loaded is the "OutlDDNativeLib".

    I cannot check this at the moment.

    Regards
    Wolfgang

     
  • wide

    wide - 2011-09-21

    Hello,

    I think there are two solutions to the problem:

    1. Load the applets from the same jar file (<applet archive="same.jar">) and use the same signature key. This ensures, that all applets are loaded by the same class loader.

    2. Use different sub-directories in OutlDDNativeLib.OUTLDD_TEMP_LIBDIR for earch of your applets.

    Regards
    Wolfgang

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.