Help regarding java.lang.UnsatisfiedLinkError

Hi everyone ,
I have a doubt regarding native property. I am using eclipse I wrote a program (inputoutput.java) to clear the screen after printing a line. This program creates an object (�console�) of �test� class and calls �clear� method. The test class loads the �ClearFunc.dll� file. I placed the ClearFunc.dll file along with the other class files. When I execute it is giving the following error.
Exception in thread "main" java.lang.UnsatisfiedLinkError: no ClearFunc.dll in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at inputoutput.test.<clinit>(test.java:15)
at inputoutput.Printing.printing(inputoutput.java:22)
at inputoutput.inputoutput.main(inputoutput.java:51)
�test.java code�
package inputoutput;
public class test {
//static final String path ="D:/java_workspace/input_output/bin/inputoutput/ClearFunc";
public native void clear();
/*public static void main(String[] args) {
new test().clear();
static {
try{
System.out.println("hi");
System.loadLibrary("ClearFunc.dll");
System.out.println("hello");
catch(Exception e)
System.out.println(e.toString()+"santhu");
e.printStackTrace();
"inputoutput.java code"/**
package inputoutput;
import java.io.*;
* @author Santhosh_Thadvai
class Printing implements Runnable{
     Thread t;
     public void run(){
     public void printing()throws IOException,FileNotFoundException {
          try{
               test console = new test();
               t=new Thread();
          t.start();
          FileInputStream fileinputstream = new FileInputStream("out.txt");
          int value = fileinputstream.read();
          while(value!=-1){
               System.out.print((char)value);
               Thread.sleep(50);
               value=fileinputstream.read();
               if((char)value=='\n')
                    console.clear();
          fileinputstream.close();
          catch(InterruptedException e){
               System.out.println(e);
public class inputoutput {
     * @param args
     public static void main(String[] args) throws IOException {
          Printing b=new Printing();
          b.printing();
}

plz, surround your code with : [code ] [ /code ]

Similar Messages

  • [Help] Another java.lang.UnsatisfiedLinkError: no ocijdbc9

    Hi All,
    I just learnt how about Oracle. Then, now I need to use JDBC driver.
    I am using Oracle 8i.
    I tried to follow the instruction in here.
    http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/jdbc817.html
    Then, I tried the basic sample provided there.
    But that give me the following error.
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no ocijdbc9 in java.l
    ibrary.path
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at oracle.jdbc.oci8.OCIDBAccess.logon(OCIDBAccess.java:300)
    at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:361)
    at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
    va:485)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:337)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at JdbcCheckup.main(JdbcCheckup.java:42)
    Can anybody tell me why? what's wrong with it?
    Moreover, I am wondering why it says no ocijdbc9, while I am using Oracle 8i.
    Could anybody explain please ...

    I suspect that you are using the oracle oci driver. That driver requires a n Oracle client installation on the machine which would be establishing connection. Moer specifically, it makes use of the native library ocijdbc9.dll and the directory containing it [if the installation has been done] should be present in the Path in environment variables.

  • Error: java.lang.UnsatisfiedLinkError: t2cParseExecuteDescribe

    Connection to DB seems fine
    Opening the connection just sits there " loading... "
    Opening a SQL Worksheet produces the following error message:
    Can someone help?
    java.lang.UnsatisfiedLinkError: t2cParseExecuteDescribe
         at oracle.jdbc.driver.T2CStatement.t2cParseExecuteDescribe(Native Method)
         at oracle.jdbc.driver.T2CPreparedStatement.executeForDescribe(T2CPreparedStatement.java:518)
         at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1134)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3339)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3384)
         at oracle.javatools.db.QueryWrapper.executeQuery(QueryWrapper.java:203)
         at oracle.javatools.db.ora.BaseOracleDatabase.createSchema(BaseOracleDatabase.java:1473)
         at oracle.javatools.db.ora.BaseOracleDatabase.<init>(BaseOracleDatabase.java:172)
         at oracle.javatools.db.ora.OracleDatabaseImpl.<init>(OracleDatabaseImpl.java:95)
         at oracle.javatools.db.ora.Oracle8.<init>(Oracle8.java:21)
         at oracle.javatools.db.ora.Oracle8i.<init>(Oracle8i.java:50)
         at oracle.javatools.db.ora.Oracle9i.<init>(Oracle9i.java:196)
         at oracle.javatools.db.ora.Oracle9iR2.<init>(Oracle9iR2.java:46)
         at oracle.javatools.db.ora.Oracle10g.<init>(Oracle10g.java:37)
         at oracle.javatools.db.ora.Oracle10gR2.<init>(Oracle10gR2.java:23)
         at oracle.javatools.db.ora.OracleDatabaseFactory.createDatabaseImpl(OracleDatabaseFactory.java:109)
         at oracle.jdeveloper.db.ora.OracleConnDatabaseFactory.createDatabaseImpl(OracleConnDatabaseFactory.java:45)
         at oracle.javatools.db.DatabaseFactory.createProviderImpl(DatabaseFactory.java:50)
         at oracle.javatools.db.DBObjectProviderFactory.createProviderFromFactory(DBObjectProviderFactory.java:190)
         at oracle.javatools.db.DBObjectProviderFactory.findOrCreateProvider(DBObjectProviderFactory.java:144)
         at oracle.javatools.db.DatabaseFactory.findOrCreateDatabase(DatabaseFactory.java:146)
         at oracle.dbtools.raptor.utils.Connections.getDatabaseImpl(Connections.java:192)
         at oracle.dbtools.raptor.utils.Connections.getDatabase(Connections.java:213)
         at oracle.dbtools.raptor.utils.Connections.getDatabase(Connections.java:201)
         at oracle.dbtools.sqlworksheet.sqlview.SqlEditorNode.init(SqlEditorNode.java:192)
         at oracle.dbtools.sqlworksheet.sqlview.SqlEditorNode.getDatabase(SqlEditorNode.java:207)
         at oracle.dbtools.sqlworksheet.sqlview.SqlEditor.openNewEditor(SqlEditor.java:1911)
         at oracle.dbtools.sqlworksheet.sqlview.SqlEditor.openNewEditor(SqlEditor.java:1968)
         at oracle.dbtools.sqlworksheet.sqlview.SqlEditor.openNewEditor(SqlEditor.java:1986)
         at oracle.dbtools.sqlworksheet.sqlview.SqlEditorWizard.invoke(SqlEditorWizard.java:108)
         at oracle.ide.wizard.WizardManager.invokeWizard(WizardManager.java:310)
         at oracle.dbtools.sqlworksheet.sqlview.SqlEditorAddin$2.actionPerformed(SqlEditorAddin.java:193)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
         at java.awt.Component.processMouseEvent(Component.java:5488)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

    See this : Re: 1.1 - Issues
    -kris

  • Java.lang.UnsatisfiedLinkError - Urgent please help

    Hi,
    I want to thank you for looking into this problem first.
    I have a very headache problem for the past week. I have an applet that uses JNI to call an existing dll to get the system resources. It works fine on windows 2000 server with IE 5.0. The dll get loaded fine and the function call is working fine.
    However, now I tried to move the applet to an application for me to test with jbuilder, I have problems and I get the error java.lang.UnsatisfiedLinkError: ooInit.
    Does anyone know why this is happening in Jbuilder. I traced to see if the dll get loaded with System.loadlibrary("dll"), and it seems to load the library. But when I call the ooInit() native method, it throws that exception.
    Please help. This will be greatly appreciated and I can do something for you guys in return.
    Thank you so much.
    Regards,
    guna

    Here, for the benefit of others who might search for this, is my approach to resolving this error.
    Two things to note:
    1. I didn't worry about paths, etc. - I was in a hurry so I just copied files into required directories.
    2. I named both the Java and C files "mainFrame". I have not subsequently checked to see if this is required, since it worked for me.
    Summary of getting jni routine to work with Jbuilder:
    created Java project mintest, two principle classes - mainFrame and WelcomeFrame
    key code fragments:
    --------------------------------------- mainFrame --------------------------------------------------
    package mintest;
    import javax.swing.JLabel;
    import javax.swing.JButton;
    import javax.swing.JPanel;
    import java.awt.GridBagLayout;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseAdapter;
    public class mainFrame {
        boolean packFrame = false;
        WelcomeFrame frame = new WelcomeFrame();
        public static native int cRoutine(int value);
        static {System.loadLibrary("mainFrame"); }
    public mainFrame() {
        //Pack frames that have useful preferred size info, e.g. from their layout
        //Validate frames that have preset sizes
        if (packFrame) {
          frame.pack();
        else {
          frame.validate();
        // Center the frame
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension frameSize = frame.getSize();
        if (frameSize.height > screenSize.height) {
          frameSize.height = screenSize.height;
        if (frameSize.width > screenSize.width) {
          frameSize.width = screenSize.width;
        frame.setLocation( (screenSize.width - frameSize.width) / 2,
                          (screenSize.height - frameSize.height) / 2);
        frame.setVisible(true);
        try {
          jbInit();
        catch (Exception ex) {
          ex.printStackTrace();
    * Main method
    * @param args String[]
    static public void main(String[] args) {
      try {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
      catch (Exception e) {
        e.printStackTrace();
      new mainFrame();
            cRoutine(1);     // this works at this point...
            System.out.println("cRoutine - should be 4: " + cRoutine(3));
      private void jbInit() throws Exception {
    }--------------------------------------- end of mainFrame --------------------------------------------------
    --------------------------------------- (portions of) WelcomeFrame --------------------------------------
    package mintest;
    import java.awt.*;
    ..... more imports, setting up of window, buttons, etc. .... iValue is an integer....
      public void jToggleButton1_mousePressed(MouseEvent e) {
          jToggleButton1.setText("cRoutine in: " + iValue + "  out: " + (iValue = 
                                   mainFrame.cRoutine(iValue)));
      }--------------------------------------- end of (portions of) WelcomeFrame -----------------------------
    mainFrame was compiled with Jbuilder into a class file, makeFrame.class. That was copied into
    the C:\Borland\JBuilder2005\jdk1.4\bin directory, and javah was run to create the C header file:
    javah -jni mainFrame
    This generated:
    --------------------------------------- mainFrame.h generated by javah ----------------------------------
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class mainFrame */
    #ifndef _Included_mainFrame
    #define _Included_mainFrame
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class:     mainFrame
    * Method:    cRoutine
    * Signature: (I)I
    JNIEXPORT jint JNICALL Java_mainFrame_cRoutine
      (JNIEnv *, jclass, jint);
    #ifdef __cplusplus
    #endif
    #endif--------------------------------------- end of mainFrame.h generated by javah -------------------------
    OKAY, HERE COMES THE CRITICAL STEP. DESPITE THE FACT THE COMMENT SAYS DO NOT EDIT, THIS FILE HAS TO BE EDITED TO INCLUDE THE PACKAGE NAME, LIKE THIS:
    --------------------------------------- modified mainFrame.h ----------------------------------
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class mainFrame */
    #ifndef _Included_mainFrame
    #define _Included_mainFrame
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class:     mainFrame
    * Method:    cRoutine
    * Signature: (I)I
    JNIEXPORT jint JNICALL Java_mintest_mainFrame_cRoutine
      (JNIEnv *, jclass, jint);
    #ifdef __cplusplus
    #endif
    #endif--------------------------------------- end of modified mainFrame.h -------------------------
    This file is then copied to the C:\Borland\BCC55\Include directory. The C code source is placed
    in the C:\Borland\BCC55\Bin directory. Here is the C code - note that it has the package name in
    the function name:
    --------------------------------------- mainFrame.c ----------------------------------
    #include <mainFrame.h>
    #include <stdio.h>
    #include <string.h>
    /* must link gpib-32.obj for Windows*/
    #include <windows.h> /*if using Windows */
    void main(){
    JNIEXPORT jint JNICALL
    Java_mintest_mainFrame_cRoutine(JNIEnv *env, jobject callingObj,jint invalue)
    return (jint) invalue+1;
    }--------------------------------------- end of mainFrame.c -------------------------
    This is now compiled on the command line (from the C:\Borland\BCC55\Bin directory) using:
    bcc32 -tWD -I\Borland\bcc55\include -L\Borland\bcc55\lib mainFrame.c
    Parameters: -tWD creates Windows DLL file
    -I is path to include directory (this is where mainFrame.h is located)
    -L is path to library directory
    Compilation produces mainFrame.dll in the C:\Borland\BCC55\Bin directory. This is copied to the C:\Borland\JBuilder2005\jdk1.4\jre\bin directory so Jbuilder can find it. Then it works.
    So, the key step is adding the package name after javah has generated the header file (and similarly using the package name in the .c source file.)
    Hope this is useful.

  • Help needed with JNI -  java.lang.UnsatisfiedLinkError

    I need some help with JNI. I am running on Sun Solaris 7 using their CC compiler. I wrote a simple java program that calls a native method to get a pid. Everything work until I use cout or cerr. Can anyone help? Below is what I am working with.
    Note: The application works. The problem is when the C++ code tries to display text output.
    My error log is as follows:
    java Pid
    Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/dew/test/libPid.so: ld.so.1: /usr/j2se/bin/../bin/sparc/native_threads/java: fatal: relocation error: file /home/dew/test/libPid.so: symbol __1cDstdEcerr_: referenced symbol not found
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1382)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1306)
    at java.lang.Runtime.loadLibrary0(Runtime.java:749)
    at java.lang.System.loadLibrary(System.java:820)
    at Pid.<clinit>(Pid.java:5)
    Pid.java
    ========
    * Pid: Obtains the pid from the jvm.
    class Pid {
    static { System.loadLibrary("Pid"); }
    public native int getPid();
    public static void main(String args[])
    System.out.println("Before construction of Pid");
    Pid z = new Pid();
    System.out.println(z.getPid());
    z = null;
    Pid.cpp
    =========
    * Native method that obtains and returns the processid.
    #include "Pid.h"
    #include "unistd.h"
    #include <iostream.h>
    JNIEXPORT jint JNICALL Java_Pid_getPid(JNIEnv *env, jobject obj) {
    /* cout << "Getting pid\n"; */
    cerr << "Getting pid\n";
    /* printf("Getting pid\n"); */
    return getpid();

    I forgot to include my build information.
    JAVA_HOME = /usr/j2se/
    LD_LIBRARY_PATH = ./:/opt/readline/lib:/opt/termcap/lib:/usr/bxpro/xcessory/lib:/${JAVA_HOME}/lib:/usr/RogueWave/workspaces/SOLARIS7/SUNPRO50/0d/lib:/usr/RogueWave/workspaces/SOLARIS7/SUNPRO50/3d/lib:/usr/sybase/lib
    javac Pid.java
    javah Pid
    CC -G -I${JAVA_HOME}/include -I${JAVA_HOME}/include/solaris Pid.cpp -o libPid.so
    Thanks again,
    Don

  • HELP: java.lang.UnsatisfiedLinkError: no ... in java.library.path

    am the beginner of JNI. I write a test program to use C code in JAVA.
    [yxz155@lionxo JAVAaC]$ ls
    AClassWithNativeMethods.java theNativeMethod.c
    [yxz155@lionxo JAVAaC]$ javac AClassWithNativeMethods.java
    [yxz155@lionxo JAVAaC]$ javah -jni AClassWithNativeMethods
    [yxz155@lionxo JAVAaC]$ ls
    AClassWithNativeMethods.class AClassWithNativeMethods.java
    AClassWithNativeMethods.h theNativeMethod.c
    [yxz155@lionxo JAVAaC]$ gcc -c -fPIC -I/usr/global/java/include -I/usr/global/java/include/linux theNativeMethod.c
    [yxz155@lionxo JAVAaC]$ ls
    AClassWithNativeMethods.class AClassWithNativeMethods.java theNativeMethod.o
    AClassWithNativeMethods.h theNativeMethod.c
    [yxz155@lionxo JAVAaC]$ ld -G theNativeMethod.o -o libJCI.so -lm -lc -lpthread
    [yxz155@lionxo JAVAaC]$ ls
    AClassWithNativeMethods.class AClassWithNativeMethods.java theNativeMethod.c
    AClassWithNativeMethods.h libJCI.so theNativeMethod.o
    [yxz155@lionxo JAVAaC]$ java AClassWithNativeMethods
    Exception in thread "main" java.lang.UnsatisfiedLinkError: no CJI in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
    at java.lang.Runtime.loadLibrary0(Runtime.java:822)
    at java.lang.System.loadLibrary(System.java:992)
    at AClassWithNativeMethods.<clinit>(AClassWithNativeMethods.java:9)
    [yxz155@lionxo JAVAaC]$
    The codes are as follows, I tried setProperty() as in java program, but it did not work. I also tried set LD_LIBRARY_PATH and it did not work either.
    //AClassWithNativeMethods.java
    import java.io.File;
    import java.lang.System;
    public class AClassWithNativeMethods{
    public native void theNativeMethod();
    static {
    //System.setProperty("java.library.path",System.getProperty("java.library.path")+ File.pathSeparator+"/home2/yxz155/JAVAaC");
    //System.out.println(System.getProperty("java.library.path"));
    System.loadLibrary("CJI");
    public static void main(String[] args){
    AClassWithNativeMethods test = new AClassWithNativeMethods ();
    test.theNativeMethod();
    // theNativeMethod.c
    #include <stdio.h>
    #include "AClassWithNativeMethods.h"
    JNIEXPORT void JNICALL Java_AClassWithNativeMethods_theNativeMethod
    (JNIEnv *env, jobject obj){
    printf("Hello~~~~");
    //AClassWithNativeMethods.h
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class AClassWithNativeMethods */
    #ifndef IncludedAClassWithNativeMethods
    #define IncludedAClassWithNativeMethods
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class: AClassWithNativeMethods
    * Method: theNativeMethod
    * Signature: ()V
    JNIEXPORT void JNICALL Java_AClassWithNativeMethods_theNativeMethod
    (JNIEnv *, jobject);
    #ifdef __cplusplus
    #endif
    #endif

    Hi all,
    I am getting the error in jdk 5:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: getObjectSize0
    at sun.instrument.InstrumentationImpl.getObjectSize0(Native Method)
    at sun.instrument.InstrumentationImpl.getObjectSize(InstrumentationImpl.java:97)
    at ObjectSizeEstimator.main(ObjectSizeEstimator.java:25)
    while executing the following code:
    public class ObjectSizeEstimator {
    static {
    System.loadLibrary("instrument");
    public static void main(String[] args) throws Exception {
    Constructor ctor = InstrumentationImpl.class
    .getDeclaredConstructor(new Class[] { long.class, boolean.class });
    ctor.setAccessible(true);
    Instrumentation inst = (Instrumentation) ctor.newInstance(new Object[] {
    Long.valueOf(0L), Boolean.TRUE });
    System.out.println(inst.getObjectSize(new Object()));
    "getObjectSize0" is the native method. All of my classpath setting is in place. Can Anybody tell me why i am getting this error.
    Thanks in advance....:)

  • HELP !!! java.lang.UnsatisfiedLinkError

    Hi All,
    I am getting the error "java.lang.UnsatisfiedLinkError: gcNocompact at
    sun.misc.Gc$Daemon.run(Gc.java:102)" while running the java code in
    AIX. The document said that this is "Thrown if the Java Virtual Machine
    cannot find an appropriate native-language definition of a method
    declared native."
    What is the reason to cause this error ?
    Any suggestion to rectify this.
    Thanks in advance.
    TC8888

    I had the same problem when attempting to use lotus domino toolkit for java... I belive that the AIX is attempting to find a .dll or similar native piece of code, but it cant be found... You need to change your system parameter 'path' (not 'classpath') to include the location of the native code. Check the documentation.

  • Help needed (the notorious java.lang.UnsatisfiedLinkError)

    Hello all.
    I'm using Eclipse 3.4.0 on Windows and getting the following error when trying to call a function from a dll which is located in the java project(Test) folder:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: Test.hello()V
         at Test.hello(Native Method)
         at Test.main(Test.java:12)Any thoughts about why this problem is happening will be very appreciated.
    This is my simple code:
    Test.java
    public class Test {
         public native void hello();
         static {
              System.loadLibrary("hello");
         public static void main(String[] args) {
              new Test().hello();
    }test.cpp
    #include <iostream>
    #include "Test.h"
    JNIEXPORT void JNICALL Java_Test_hello
      (JNIEnv *env, jobject obj)
         std::cout<<"Hello World!"<<std::endl;
    }Test.h
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class Test */
    #ifndef _Included_Test
    #define _Included_Test
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class:     Test
    * Method:    hello
    * Signature: ()V
    JNIEXPORT void JNICALL  Java_Test_hello
      (JNIEnv *, jobject);
    #ifdef __cplusplus
    #endif
    #endif

    Anton1981 wrote:
    Hello all.
    I'm using Eclipse 3.4.0 on Windows and getting the following error when trying to call a function from a dll which is located in the java project(Test) folder:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: Test.hello()V
         at Test.hello(Native Method)
         at Test.main(Test.java:12)
    The exception tells you that java did not find the method that it was looking for.
    Your library was loaded otherwise another exception would have occurred.
    Per your posted code the above exception does not match (line 11 versus line 12). That could just be a cut and paste though.
    Presumably you do not have a package in Test because otherwise your C++ code does not match.
    Most problems of this sort are because the java method signature does not match the C method signature but your appears to be correct. But to be safe you might want to
    1. Delete the dll/h file
    2. Delete the class files
    3. Recompile java
    4. Rerun javah
    5. Confirm the signature still matches in your cpp file.
    6. Rebuild the dll.
    Also try running your code before step 6. If you get an exception besides one that says your library is missing then you still have a library somewhere (which is another source of possible problems.)

  • Data Quality vendor-specific error: An error occurred when calling function 'sdq_init_connector ()' in connector ": "(-8) Exception!." Detailed error message: Exception thrown by Java: java.lang.UnsatisfiedLinkError: nio (Not found in com.ibm.oti.vm.boots

    When attempting to create a new Account in siebel integrated with OEDQ the following error occurs.
    ERROR
    Data Quality vendor-specific error: An error occurred when calling function 'sdq_init_connector ()' in connector ": "(-8) Exception!." Detailed error message: Exception thrown by Java: java.lang.UnsatisfiedLinkError: nio (Not found in com.ibm.oti.vm.bootstrap.library.path)(SBL-APS-00118)
    STEPS
    The issue can be reproduced at will with the following steps:
    1) from EDQ director we have imported the EDQ_CDS,EDQ-REFERENCE DATA & EDQ_HISTORICAl DATA packages sucessfully.
    2) Created dnd.param file in SIebel server SDQCOnnector folder.
    3) Copied the libdnd.so file to siebsrvr lib directory(32 bit)
    3) In dnd.param file we have mentioned the javalib file and instllation directory path(<Siebsrvr roo>/dnd/install)
    4) Unzipped the EDQ-Siebel Connector files in dnd/install folder
    5) Copied the dnd.properties file in dnd/install directory and modified it accordingly to point to installed EDQ instance.
    6) Configured the Siebel components for EDQ integration.
    7) Realtime EDQ jobs are running.
    8) Create a new Account
    Env details are
    On : 8.2.2.14 [IP2014] version, Client Functionality
    EDQ 11.1.1.7.4
    IBM JDK 1.7 32 bit
    Using Open UI
    Any Champ have faced this issue and overcame it please let me know the resolution steps. your help is
    Regards
    Monoj Dey
    9007554589

    Hi Monoj,
    A few questions:
    - What OS is Siebel running on?
    - What version of the Siebel connector are you using?
    - Which libdnd.so file are you using?
    - What's the contents of your dnd.parms file?
    thanks,
    Nick

  • Java.lang.unsatisfiedLinkError

    Hello,
    I am currently experimenting with the jni. I've downloaded some source files available in the tutorials which i have found through java.sun.com. For example: HelloWorld.java calls a native method (implemented in HelloWorld.c), to print "Hello World!", by calling that native method. When i compile HelloWorld.java into HelloWorld.class and create a .dll file from HelloWorld.c, everything is fine. The problem arises when i try to run the whole thing by submitting in the commandline of j2sdk1.4.1: java HelloWorld. Then the following output appears:
    Exception in thread "main" java.lang.unsatisfiedLinkError: print
    at HelloWorld.print(native method)
    at HelloWorld.main(HelloWorld.java:9)
    At first i got more linking errors because he couldn't locate the HelloWorld.dll file, but that problem is solved. Still, he doesn't seem to find the native method print...
    Can anyone help me with this problem?
    Thanks,
    doubleu007

    Hi!
    Edit the HelloWorld.h file and change the function declaration to this:
    extern "C" JNIEXPORT void JNICALL Java_HelloWorld_print(JNIEnv*, jobject);
    Then compile it and it�lll work fine.
    Regards,
    Guilherme

  • Java.lang.UnsatisfiedLinkError: DBDisconnect

    Hi Guys,
    I tried using the Connection pool APIs from db2jcc.jar for DB2 UDB v8.1.
    While i try to execute the following code i got the exception
    java.lang.UnsatisfiedLinkError: DBDisconnect.
    Please help me to find the problem, there is no .dll to be loaded in this regard as for as i concern.
    import java.sql.Connection;
    import java.sql.SQLException;
    import java.sql.DatabaseMetaData;
    import javax.sql.ConnectionEventListener;
    import javax.sql.PooledConnection;
    import javax.sql.ConnectionEvent;
    import com.ibm.db2.jcc.DB2ConnectionPoolDataSource;
    public class DB2Pooling implements ConnectionEventListener {
    private static final String DB_NAME = "SAMPLE";
    private static final String DB_SERVER = "db2admin";
    private static final String DB_USER = "administrator";
    private static final String DB_PASSWORD = "Welcome123";
    public static void main(String[] args) throws SQLException {
         new DB2Pooling().test();
    public void test() throws SQLException {
         System.out.println("1");
         DB2ConnectionPoolDataSource db2ConnectionPoolDataSource = new DB2ConnectionPoolDataSource();
         System.out.println("2");
         db2ConnectionPoolDataSource.setDatabaseName(DB_NAME);
         System.out.println("3");
         db2ConnectionPoolDataSource.setServerName(DB_SERVER);
         System.out.println("4");
         PooledConnection pc = db2ConnectionPoolDataSource.getPooledConnection(DB_USER,DB_PASSWORD);     System.out.println("5");
         pc.addConnectionEventListener(this);
         System.out.println("6");
         Connection c = pc.getConnection();
         System.out.println("7");
         DatabaseMetaData metaData = c.getMetaData();
         System.out.println("8");
         System.out.println("Product name: "+ metaData.getDatabaseProductName());
         System.out.println("9");
         System.out.println("Product version: "+ metaData.getDatabaseProductVersion());
         System.out.println("Driver name: "+ metaData.getDriverName());
         System.out.println("Driver version: "+ metaData.getDriverVersion());
         c.close();
         try {
         java.lang.Thread.sleep(5000);
         } catch (InterruptedException ie) {
    public void connectionClosed(ConnectionEvent event) {
    System.out.println("connectionClosed method called.");
    public void connectionErrorOccurred(ConnectionEvent event) {
    System.out.println("connectionErrorOccurred method called.");
    Bolded code is giving problem..
    thanks in advance

    Hi All,
    I have got a solution for the posted problem. actually the missing code is
    db2ConnectionPoolDataSource.setPortNumber(50000);
    eventhough the default port of DB2 server is 50000, we have to mention it explicitly. otherwise it'll try to load the DLL file and if there is any problem loading the dll, it'll give the above said exception.
    thanks to all those who tried to bring the solution.

  • Java.lang.unsatisfiedlinkerror:c:\jbuilder9\jdk1.4\jre\bin\fontmanager.dll

    Hi there, could some of you help me here please, because I am really desperate. As you might have noticed by my topic I am using JNI, but I get an error when I want to make a simple form in java.
    I compiled my java program setp by step, I have an application with a simple frame in it, but when it wants to compile the frame constructor, I encounter this error:
    java.lang.unsatisfiedlinkerror :c:\java\jbuilder9\jdk1.4\jre\bin\fontmanager.dll
    The specified procedure could not be found.
    at java.lang.ClassLoader$NativeLibrary.load (Native Method)
    In fact I'm trying to get the HWND of a java frame via a native method in C++.
    Kind Regards
    Sirwah

    Try
    1. putting c:\java\jbuilder9\jdk1.4\jre\bin in your Windows path
    2. Setting JAVA_HOME environment variable to c:\java\jbuilder9\jdk1.4\jre
    OR
    3. Dirty shamefull workaround, last resort... copy fontmanager.dll to the directory you start your application from !
    regards,
    Owne

  • Java.lang.UnsatisfiedLinkError: no ocijdbc8

    I received the java.lang.UnsatisfiedLinkError: no ocijdbc8 error while running the following command:
    java OracleXML putXML -user xxx/xxx .....
    I saw a few posts regarding dll files for NT but nothing for AIX.
    Any help would be greatly appreciated.
    Thanks,
    John

    Hi Jinyu,
    Here are the things I was checking for to fix this error.
    I made sure the xsu12.jar and classes12.zip file were in the classpath, and they are.
    I made sure the directory that contains the libocijdbc8.so library was in the classpath. It wasn't so I added it.
    I added the directory that holds the libocijdbc8.so library to the LD_LIBRARY_PATH env variable.
    Thanks,
    John

  • Java.lang.UnsatisfiedLinkError(cause: architecture word width mismatch)

    Hi All,
    I am running 64 bit JRE, and trying to load a 32 bit library provided by USPS. The jre is running on a 64 bit Linux environment.
    The code works perfectly fine on a 32 bit linux environment running a 32 bit JRE.
    The error we are getting is as follows;
    java.lang.UnsatisfiedLinkError: /tmp/usps4cb.so: /tmp/usps4cb.so: cannot open shared object file: No such file or directory (Possible cause: architecture word width mismatch)
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1647)
    at java.lang.Runtime.load0(Runtime.java:769)
    at java.lang.System.load(System.java:968)
    at gov.usps.USPS4CB.loadLibrary(USPS4CB.java:308)
    at gov.usps.USPS4CB.getBarCode(USPS4CB.java:215)
    Could someone help us here.
    Thanks & Regards,
    -Lester

    (Possible cause: architecture word width mismatch)As a guess that basically means the build will not load. So either you need a new build or you need to wrap it in a 64 build that correctly calls out to the 32 bit build.

  • URGENT: java.lang.UnsatisfiedLinkError

    Hi all,
    I'm calling a particular method which in turn calls a native method. But this gives an error:
    java.lang.UnsatisfiedLinkError: no ifjapi90 in java.library.path
    But just before the method call I set the System property java.library.path with the location of this file. After that i also print the same which is satisfactory. But it still gives me an error.
    The following is the console output:
    ==========================
    Inside parseFMB
    java.library.path: :\oracle\ora9i_dev\bin;D:\oracle\ora9i_dev\bin\ifjapi90.dll;D:\oracle\ora9i_dev\bin\ifjapi90.sym;
    java.lang.UnsatisfiedLinkError: no ifjapi90 in java.library.path
    void java.lang.ClassLoader.loadLibrary(java.lang.Class, java.lang.String, boolean)
    void java.lang.Runtime.loadLibrary0(java.lang.Class, java.lang.String)
    void java.lang.System.loadLibrary(java.lang.String)
    void oracle.forms.jdapi.Jdapi.<clinit>()
    java.lang.String com.churchill.formsgen.xml.FormParser.parseFMB()
    void com.churchill.formsgen.FormsAnalyser$39.run()
    void java.lang.Thread.run()
    Please help. This is quite urgent.
    Regards,
    Naveen

    This did not help. I loaded the library using
    System.load but it still gives the same error. Is
    there no way I can set the System property
    java.library.path after startup?
    Did you provide the complete path to the library using load()?
    If you did then I would suggest using java.io.File to test that path for existence before calling load() to see if it is correct.

Maybe you are looking for

  • Reg: Sale Order short close at Schedule lines level

    Dear Gurus, Requirement is to close all open schedule lines beyond one month. In detailed. User Enters Manual Schedule Lines as per the requirement of the customer say for 6 months. for Eg . Sale order entered on 1st of august to Dec with 500 qty, sc

  • Automatic date update in Pages for iPad

    I want the date (date feild?) in a Pages for iPad letter template to update automatically (using the system date, like other word process application) but cannot see how to do this. This automatic date update appears to work in the Pages for iPad tem

  • Nokia E71 Menu View Totally Changed. How to revert...

    The menu view of my nokia e71 has changed radically. the installations,connectivity,media,tools etc all the folders have disappeared and all their contents (buetooth,infrared,gps,realplayer,recorder etc) are cluttering up the menu. i want all the fol

  • Very Unusual Problem in BDC in date fiels

    Hi All, In my BDC , Date field is captured as 20091127 on then screen, where as in  in flat file date field is written as 27.11.2009. When i press Enter to the OK Code  move to the next screen .Date foeld changes to 20.09.1127 and showing error in ta

  • Does BOE leave a copy of a completed job on a server?

    Hi, I'm fairly new to the Business Objects Enterprise. I only use it for report auto distribution to SMTP addresses. I noticed that the hard drive space is getting filled up and I suspect this is due to the BOE leaving a copy of a sent report in one