How to Load 2 library files using System.loadLibrary in one .java file!!!

Hello,
Someone please help me. What I am trying to do is load two .DLL files in my program. Program works fine when I
do the following way i.e. I have two .java files and in each I am loading one .DLL file. But I don't want to have
two .java files I want to load both the .DLL files in one program.
**************** Example.java **********
import java.io.*;
import java.util.*;
public class Example
public native int A(String in);
static
System.loadLibrary( "API2" );
public static void main( String args[])
     Ex ex = new Ex();
     int r;
     r = ex.A("TEST");
public Example()
*****************Ex.java*****************
public class exsysml
public native int A(String in);
public exsysml()
System.loadLibrary("API3");
The above way works. But I need only one .java file to load both the .DLL files. i.e.
import java.io.*;
import java.util.*;
public class Example
public native int A(String in);
static
System.loadLibrary( "API2" );
System.loadLibrary( "API3" );     
public static void main( String args[])
     Example ex = new Example();
     int r;
     r = ex.A("TEST");
public Example()
but when I do this way it doesn't work and I get a UnSatisfiedLinkage Error at ex.A("TEST"). While doing the top way it works.
How can I fix this to just have one .java file and load both the library files as done in the bottom program but doing this program doesn't work. Any help is appreciated.
Thanks!

what I figured out so far is that we can only load one library file in a single class and define all the native methods present in that library in the class where we are loading it. Means we can't load multiple library files in a single class. It's just my thought else if someone provides a better solution. I may be wrong so that's why I need your help.
Thanks

Similar Messages

  • How do you create a save as default folder for MP3 files used Captivate text to audio voices files?

    How do you create a save as default folder for MP3 files used Captivate text to audio voices files?

    Hi Ed
    Thank you for contacting me, however I already know how to save text to
    audio files via timeline using the Export feature.
    So my question was not entirely clear and I apologize for that.  To explain
    further, whenever I save a text to audio file, captivate takes me to a
    default save as folder where I then have browse back to my production
    folder where I am keeping all my Txt to Aud files.  This is very tedious
    process when you have alot of files to save.  So my question was is there a
    way to configure captivate so I can make my production folder the default
    file for whenever I save a Txt to Audio file through Export feature that
    the system automatically takes me to that production folder, and I am
    spared the long tedious process of saving the file manually to the
    prodcution folder I want.
    I have copy the pathway to the production folder in the URL filed in the
    Save As dialoge box and that workaround as cut the work down but I still
    have to paste that URL field to point the file to the right folder. So it
    would be nice if I could do everything automatically.  Microsoft makes this
    capability in their MS Office applications, so I was thinking Adobe might
    do the same thing.  Your help with this would be appreicated,
    Thanks
    Merrill Roberts
    Sr. Training Specialist
    SunGard Availability Services
    Direct 925-831-7730
    Mobile:415-215-9280

  • How to export book pdf using custom presets for all book files in indesign using javascript

    How to export book pdf using custom presets for all book files in indesign using javascript.

    Hi jackkistens,
    Try the below js code.
    Note: you can change your preset name in below (e.g, Your preset name).
    var myBook = app.activeBook;
    myBook.exportFile(ExportFormat.PDF_TYPE, File (myBook.filePath+"/"+myBook.name.replace(/\.indb/g, ".pdf")), false, "Your preset name", myBook.bookContents, "Book_PDF", false);
    example:
    var myBook = app.activeBook;
    myBook.exportFile(ExportFormat.PDF_TYPE, File (myBook.filePath+"/"+myBook.name.replace(/\.indb/g, ".pdf")), false, "[High Quality Print]", myBook.bookContents, "Book_PDF", false);
    thx,
    csm_phil

  • How to load an applet using custom classloader ?

    Hi All,
    How to load an applet using custom classloader rather than using default browsers classloader i.e AppletClassLoader usually ?
    Regards,
    Kumar.

    I would guess that that would require two applets.
    The first does nothing but create the custom class loader and then load the second applet.

  • System.loadLibrary(weblogicoci38) threw java.lang.UnsatisfiedLinkError

    My application runs on WLS7.0. I am not able to create a connectionPool due to the following error. I have the /apps/bea2/wlserver7.0sp2/server/lib/solaris/oci817_8 specified in LD_Library. Can anyone please help me resolve this problem. Thanks
    <Error> <JDBC> <s0993dev> <omfmserver> <main> <kernel identity> <> <001060> <Cannot startup co
    nnection pool "oraclePool" weblogic.common.ResourceException: weblogic.common.ResourceException:
    Could not create pool connection. The DBMS driver exception was:
    java.sql.SQLException: System.loadLibrary(weblogicoci38) threw java.lang.UnsatisfiedLinkError: /apps/bea2/wlserver7.0sp2/server/l
    ib/solaris/oci817_8/libweblogicoci38.so: ld.so.1: /apps/bea2/jdk131_06/bin/../bin/sparc/native_threads/java: fatal: libclntsh.so.
    8.0: open failed: No such file or directory

    Do you ever find a solution to this error. I am
    receiving the same error, although I am using the
    Oracle 9.2.0 driver. I have verified that my
    LD_LIBRARY_PATH is correct. Any information would be
    grateful.
    How did you verify it?
    Did you log in as the user that weblogic runs under? And then you ran a java app that loaded the lib?

  • System.loadLibrary(weblogicoci37) threw java.lang.UnsatisfiedLinkError:

    Hello,
    I have a problem about jDriver
    the configuration is:
    solaris 8
    WLS 6.1 sp2
    Oracle9i 9.0.1
    jDriver oci 901_8
    (Weblogic server and Oracle db in same machine)
    I follow the "Installing WebLogic jDriver for Oracle" setting from BEA online
    documantation.
    but I got some error and exception as follow:
    Could not create pool connection. The DBMS driver exception was:
    java.sql.SQLException: System.loadLibrary(weblogicoci37) threw java.lang.UnsatisfiedLinkError:
    /export/home/bea/wlserver6.1/lib/solaris/oci901_8/libweblogicoci37.so: ld.so.1:
    /export/home/bea/jdk131/jre/bin/../bin/sparc/native_threads/java: ?P?R??: /usr/local/oracle/OraHome1/lib/libclntsh.so.9.0:
    ???~?? ELF ??§O?G ELFCLASS64
         at weblogic.jdbc.oci.Driver.loadLibraryIfNeeded(Driver.java:226)
         at weblogic.jdbc.oci.Driver.connect(Driver.java:76)
    somebody can give me a hang,thanks!!!
    -Winson

    You need to have /export/home/bea/wlserver6.1/lib/solaris/oci901_8 in your LD_LIBRARY_PATH env variable so that the library
    can be found and loaded dynamically. Check the startWebLogic.sh script for an example and make sure that it is getting set
    appropriately when you start the server.
    Bill
    Winson Lee wrote:
    Hello,
    I have a problem about jDriver
    the configuration is:
    solaris 8
    WLS 6.1 sp2
    Oracle9i 9.0.1
    jDriver oci 901_8
    (Weblogic server and Oracle db in same machine)
    I follow the "Installing WebLogic jDriver for Oracle" setting from BEA online
    documantation.
    but I got some error and exception as follow:
    Could not create pool connection. The DBMS driver exception was:
    java.sql.SQLException: System.loadLibrary(weblogicoci37) threw java.lang.UnsatisfiedLinkError:
    /export/home/bea/wlserver6.1/lib/solaris/oci901_8/libweblogicoci37.so: ld.so.1:
    /export/home/bea/jdk131/jre/bin/../bin/sparc/native_threads/java: ?P?R??: /usr/local/oracle/OraHome1/lib/libclntsh.so.9.0:
    ???~?? ELF ??§O?G ELFCLASS64
    at weblogic.jdbc.oci.Driver.loadLibraryIfNeeded(Driver.java:226)
    at weblogic.jdbc.oci.Driver.connect(Driver.java:76)
    somebody can give me a hang,thanks!!!
    -Winson

  • How to generate Webservices.xml using tool in Sun One App Server?

    How to generate Webservices.xml using tool in Sun One App Server?

    Hi,
    The build.xml file should be in a directory from where
    you are running the asant command.
    To resolve the common.xml file not found error,
    open your build.xml and check from which location the common.xml file is incuded.
    In the sample application it is four directories above
    the directory where build.xml is located.
    You can copy the common.xml in the current directory and then change the following in your build.xml
    <!ENTITY include SYSTEM "../../../../common.xml">
    to <!ENTITY include SYSTEM "common.xml">
    Hope this helps.
    Get back in case you have more issues

  • How to execute one java file in another java file

    Hi All!
    I hava a problem.. I need to validate functionality of one java file in my Junit test case.. so, I need to run that java file in my test file..
    How should I start with???? Are there any java API's for that.. I checked 'system' ..but which function will suite that functionality,,I am not sure about..

    I need to check the functionality of deletetion which
    is done by a java class.. Now I need to check this
    functionality..whether it is deleting or not... in my
    test case.. so, for that I need to execute that java
    file in similar manner as how we normally do it...,
    in my test case..So let the test case create a file and have your class delete it. What's there to run?

  • How do you overlap PDF's and finish with one PDF file? Need help ASAP

    how do you overlap PDF's and finish with one PDF file?
    Need help ASAP

    I'm not sure if you can do that with CreatePDF.  Try it; you got one free use when you sign up with Acrobat.com
    If not, you will have to use Adobe Acrobat; there is a full-use 30 days trial.

  • Compiling one java file within another java program

    Hi all,
    I want to compile one java file say one.java within a java program say second.java.. i simply have no idea as how to proceed ..pls help!!

    http://onesearch.sun.com/search/onesearch/index.jsp?qt=dynamically+compile&subCat=siteforumid%3Ajava31&site=dev&dftab=siteforumid%3Ajava31&chooseCat=javaall&col=developer-forums
    Just to give you an idea.

  • Help please - Updating .jar file and can't compile decompiled .java files.

    Ok, so there is a game on the internet called 'runescape', its a java applet that runs in the web browser from a cache in the windows directory.
    Basically im trying to edit this client so that i can run it away from their website (for use on a private server).
    The problem i am getting is that when i decompile the class files from the .jar into the .java files i can't recompile the .java files.
    E.G. I decompiled one of the .class files and tried to re-compile it agian straight away which brought me errors, i did this to rule out my editing as the problem.
    The jar file can be found [here.|http://world80.runescape.com/loader_gl397188536.jar] but the link will no double be dead after a few weeks.
    Can somebody please take a look and help me? I'm fairly new to java programming so if you could keep your answers as simple as possible that would be great, thanks.
    Ps. If this is the wrong section im sorry, i couldn't find the right section and this section seemed closest for me.

    i'm compiling using the javac command in a batch file, its displaying 100 errors but there are more, it seems to be showing that the syntax is incorrect as it is labeling brackets as being in the incorrect places.
    Decompiling error?
    As for being allowed to do this, im not so sure the company would approve but im only doing this for learning purposes and will not be releasing any of it upon the internet.

  • System.loadLibrary() and DLL manifest files

    Hi,
    Has anyone gotten Java WebStart working with VisualStudio 2005 DLL manifest files? That is, it is illegal to load DLLs without having the manifest file visible. Last time I checked, Webstart did not extract native DLLs from JARs until System.loadLibrary() was used -- but this would not work for manifest files.
    The only workaround I can think of is embedding the manifest files inside the DLL but this sounds a bit ugly.
    A related problem is that if I System.loadLibrary() on library A and it depends on library B which I have never loaded before then this will fail because Webstart did not extract B.
    This is related to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6191612
    Any ideas?
    Gili

    The dll is
    deployed as part of a J2EE application, and shouldn't
    need registering by the regsvr32 program.regsvr32 should have nothing to do with JNI dlls. Unless the dll is also a COM object factory (or what ever the proper name for such a thing is), then regsvr32 should make no difference to its operation.
    >
    Can anyone explain the difference between the load()
    and loadLibrary() methods in detail?They do the same thing, except that for load() you specify the full path to the object and with loadLibrary() you just give its base name and the runtime tries to find it in the java.library.path after adding ".dll" to the name.
    You should only call one or the other. Calling both would be an error.

  • Cannot load sharedfile.so by System.LoadLibrary() in a remote machine

    Hi, I am facing a weired problem. I have written a very simple java native interface program that works fine in my computer. But when I
    ssh to another machine and run the same code there..
    class TestJni
         static
         try
         System.loadLibrary( "test" );
         catch( UnsatisfiedLinkError e )
         * System.out.println("Could not load native code for user authentication." ); *
         System.exit(1);
         public static void main( String [] args )
    public static native int sum( int x, int y );
    The output is: Could not load native code for user authentication.. which means the catch block has executed and the program is not being able to
    load the shared library. To run the code I am doing something like this:
    LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH java TestJni
    this works fine in my pc... but is there any limitation in running the code remotely.. this does not make any sense though...

    It's a bug, fixed in TT 7.0.4.

  • How to load the data using a plsql table in ODI.

    Hi All ,
    Can anyone help me on this ?
    We have a PLSQL procedure which returns a plsql table as out parameter.
    We are supposed to load the data in to a file using this plsql table (Table type) in ODI.
    Can this be done using ODI?
    Regards,
    Karthik+

    Hi,
    We have one process with a ref cursor (Oracle) as a source and remote Oracle DB as a target. I ended up writing my own KM that populates a global temporary table from the cursor first and then transfers the data to target. If temporary table is an option for you, the rest is pretty easy.
    Regards.

  • How to load a variable using MATLAB Script?

    I need to load a selected variable from .mat file, using MATLAB script , and analyse it.
    the attched shows my vi, there are two inputs nodes 'file' contains the .mat file path, and 'varn' contains varibale name in that .mat file which can be selected by user. Using " load(file)" the whole .mat file is loaded in the workspace and become avaiable at output node, however I am not able to pass a selected variable name through string "varn" input, MATLAB script does not recognize the variable.
    any idea to reslove it is realy appreciated.
    Attachments:
    load a variable.JPG ‏18 KB

    Download the VI and .MAT file. Run the VI, and it'll plot the data inside of the .MAT file.
    Andy Chang
    National Instruments
    LabVIEW Control Design and Simulation
    Attachments:
    testfile.zip ‏5 KB

Maybe you are looking for

  • Restore Mac from Time Machine, after grey screen

    I'm working with an iMac running Mountain Lion from 2011 with Intel chip The computer keeps loading up to grey screen. I was able to get to the screen where I get to choose Restore from Time Machine Reintsall OSX Get help online Disk Utility I try to

  • Brand new mac mini won't boot

    I bought a mac mini for my teenaged daughter because the lap top options simply weren't in our price range. I have a high end dell monitor that is about five years old. It hasn't been used regularly so I felt this was a good fit. I was reassured by s

  • Converting PNP related statement to simple ABAP

    Hello, i had a report which uses PNP logical database of HR module. the code contains two specific lines to be used with it. Get PERNR. and rp_provide_from_last p0000 space pn-begda pn-endda. Now i want to do the same functionality using simple ABAP

  • Mail receiver

    Hi, I have problem with Mail Receiver ComCh. When I set it up to use local SMTP server with user/pwd and CRAM-MD5, error is : failed to send mail: java.io.IOException: server not responding OK to AUTH; 535 5.7.0 authentication failed When I set Plain

  • What operating system is needed for mac to download Illustrator? I am currently running OS X 10.6.8

    I just bought the single creative cloud for illustrator and when I try to download it says it doesn't support my operating system. I have a macbook running OS X 10.6.8..... What do I need to do to download the program? I have enough space as well so