System.loadLibrary() conflict beetwen C++ and GCC

Hallow.
When I try to compilate a C library that uses a C++ class with the GCC (GNU) compiler it doens't recognize the class. ok!
But, when I complile the same C library using the C++ (GNU) compiler, the 'System.loadLibrary()' does not find the library.
What should I do?

The symbols that are generated for C and C++ will be different because of name mangling that occurs for C++ symbols. System.loadLibrary will give an error because it will not find the symbol it expected to find. In the header file for the C library, can you try putting in the following lines :
Before all the function definitions :
#ifdef __cplusplus
extern "C" {
#endif
After the function definitions :
#ifdef __cplusplus
#endif
This will force the g++ compiler to not mangle the names of the C functions.
hth
rahul

Similar Messages

  • 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.

  • [SOLVED]gcc-libs and gcc-libs-multilib are in conflict

    Can't update today.
    [glow@GlowArch ~]$ sudo pacman -Syuv
    :: Synchronizing package databases...
    core is up to date
    extra is up to date
    community is up to date
    multilib is up to date
    catalyst is up to date
    :: Starting full system upgrade...
    warning: android-udev: local (98-1) is newer than community (r100-1)
    resolving dependencies...
    looking for inter-conflicts...
    :: gcc-libs and gcc-libs-multilib are in conflict. Remove gcc-libs-multilib? [y/N] n
    error: unresolvable package conflicts detected
    error: failed to prepare transaction (conflicting dependencies)
    :: gcc-libs and gcc-libs-multilib are in conflict
    I assume there is some update going on, i will try again in some time.
    Last edited by GloW_on_dub (2014-05-09 14:04:57)

    [glow@GlowArch ~]$ sudo pacman -Syu --ignore gcc-libs
    :: Synchronizing package databases...
    core is up to date
    extra is up to date
    community is up to date
    multilib is up to date
    catalyst is up to date
    :: Starting full system upgrade...
    warning: android-udev: local (98-1) is newer than community (r100-1)
    resolving dependencies...
    warning: ignoring package gcc-libs-4.9.0-2
    warning: cannot resolve "gcc-libs=4.9.0-2", a dependency of "gcc"
    warning: cannot resolve "gcc=4.9.0-2", a dependency of "gcc-fortran"
    :: The following package cannot be upgraded due to unresolvable dependencies:
    gcc-fortran
    :: Do you want to skip the above package for this upgrade? [y/N] n
    error: failed to prepare transaction (unexpected error)
    You're right, i have indeed a dependency problem because of this aur package, acml-gfortran, wich have in it's dependencies gcc-fortran instead of gcc-fortran-multilib
    The thing i don't understand is how have i been able to install gcc-fortran with acml-gfortran, without trying to install gcc-libs and discovering the conflict at that time,
    and also why the fact that there is a gcc-fortran and gcc-libs update without the corresponding update in the multilib version discover the conflict.
    I've commented the aur package, so the maintainer will soon fix the problem, yet i don't understand fully why this conflict have appeared now.

  • How do i recompile whole system with glibc and gcc from test

    I always run testing and hence upgraded all my system a couple of days back. How ever one pprogram i use very often, BLENDER isn't working after i upgraded glibc and gcc4. I have recompiled it but when I get all this errors when i start it http://bbs.archlinux.org/viewtopic.php?t=21825.
    I think i need to rcompile all its dependant programs with new glibc and gcc from testing also. Problem is I dentifying which programs to compile is proving a pain as the dependant programs also depend on other programs etc...
    Is there a way to recompile my whole system without having to do it one by one?

    if you want to compile everything, gentoo is an option. But abs is excellent too.
    P.S. Gentoo's compilation drove me out of it

  • Compilation and System.loadLibrary

    Hi everybody,
    I'm pretty sure this will be the last time I talk about System.loadLibrary issues. This is definitely just a concept question, no code or JNI needed.
    I have a call to System.load library like this:
    System.loadLibrary( "Class" );
    and then directly after that, a I call a constructor for the class:
    Class c = new Class( params );
    The problem is, though, that the code won't compile. I know the constructor is right, and I've looked at the System.loadLibrary documentation, and I can't figure out what the problem is. I know System.loadLibrary is a runtime event, and I'm using Eclipse, if that makes any difference.
    So, I guess here comes the question finally. How can I make the compiler realize that the class I'm loading with System.loadLibrary is legitimate, so it doesn't give me a compiler error?
    Thanks,
    Jezzica85

    jezzica85 wrote:
    Oh, I'm sorry. That was just a general example, and yes, "Class" was just a fill-in for what I actually named the class, and "params" a fill-in for the parameters. I figured the specifics weren't important. I guess I should have made that example clearer.
    Jezzica85I just wanted to make sure.
    So, you have a class called whatever you have there in your classpath, and you've verified that it has a public constructor with the same parameters that you have given it? If both those statements are true then I don't see how you can have a compiler error involving the ctor - please post a copy and paste of the exact compiler error message.

  • Creating JNI DLL on WinXP using MinGW and GCC

    Ohh man, I spent entire day fighting with "UnsatisfiedLinkError "while trying to cal my native method. After reading all the posts with similar problems, and checking for every little thing that was suggested I figured it out. So I'm reposting the solution here since no one else had suggested this.
    The solution to my problem was that g++/gcc compiler needed an option "-Wl,--add-stdcall-alias". This was the killer. I had the "-shared", but it wouldn't link without the "-Wl,--add-stdcall-alias" option!!!
    As a summary, while its fresh in my mind, here are the trouble shooting steps I used:
    1) Check package names and the generated .h file using javah. I checked and rechecked the names, even created simpler static void method to try and get it to link.
    2) Make sure to use the "jobject" parameter for dynamic methods and "jclass" for static methods in the signature as second argument.
    3) That method name starts with "Java_" and I stress the CAPITAL "J", can not be lowercase. Although if you are using javah, that should not be the problem, since javah can not ommit this kind of detail. The only thing that you need to check for is that if you change method from dynamic to static, and don't rerun the javah, or javah doesn't replace the previous file. So make sure you restart clean and that javah regenerated the file with "jclass" or "jobject" whichever is the case.
    4) Used the "java -verbose:jni" debug flag to see my native method loaded. In my case when it wasn't working I couldn't see the method load, but there were no error messages from "System.loadLibrary" or from the verbose output. Only the UnsatisfiedLinkError. Frustrating. After the fix it loads perfectly:
    [Dynamic-linking native method org.jnetpcap.Pcap.openVoid ... JNI]5) I used "nm" found at "c:/MinGW/bin/nm.exe" to dump the symbol table, and I could see all my methods, with the appropriate named marked as text (T) flag. They were not being loaded when viewed using "java -verbose:jni" though.
    6) I put "extern "C" {}" around all my JNI C++ methods.
    7) Tried a gazilion other gcc options, posted in various messages, none worked.
    8) Finally came accross the "-Wl,--add-stdcall-alias" flag which fixed it.
    Here is a portion of my Makefile for reference:
    $(LINK_TARGET) : $(OBJS)
         g++ \
              -shared \
              -Wl,--add-stdcall-alias \
              -o $@ $^ \
              $(LIBDIRS) $(LIBS)LIBDIR and LIBS point to a single external library dependency.
    My IDE environment is Eclipse 3.2, but I run everything from Makefiles as external programs.
    I wish this was documented somewhere, would have saved me an entire day of troubleshooting.
    Cheers,
    mark...
    Message was edited by:
    voytechs - added CODE tags

    Glad my post helped out at least a few people.
    Believe it or not, I'm in the same boat now on Linux.
    Atleast I know its the name mangling problem again. I
    see a few symbols unmangled with nm, but most are,
    and those are then one's JNI is complaining about
    with UnsatisfiedLinkError.
    So now I'm going through various post related to
    linux and trying to find the same type of flag. The
    "alias" flag doesn't work with RH4 g++ version
    4.0.2.You should not need a flag on Linux. A typical compile for me on my Linux box is:
    gcc -shared -o libjnitest.so -I/usr/java/jdk1.6.0_01/include -I/usr/java/jdk1.6.0_01/include/linux jnitest.c>
    Window builds perfectly fine, but now I'm creating a
    new platform target. Everything compiles and creates
    the shared library, just can't get JNI to be happy.
    BTW, my project: http://jnetpcap.sf.net
    Ah. You have .cpp extensions on your filenames. Are you using gcc or g++ to compile? If you don't use g++, you can get errors such as:
    undefined symbol: __gxx_personality_v0
    Jim S.

  • System.LoadLibrary + dlopen -- callback causes unresolved symbol

    Hi guys,
    I am currently trying to use the API
    System.loadLibrary(String name)in order to dynamically link shared libaries to SOLARIS JVM.
    I am facing some unresolved symbol at run-time .
    I load a shared library libhello1 (using system.LoadLibary)
    and I call from this lib (via JNI interface) a method which
    loads a second library libhello2(using dlopen) and invokes hello2().
    hello2 will call back a method hello_bug which is implemented in libhello1.
    There is the a mutual or cyclic dependence. This dependance is correctly handled if I link the libhello1 to a standard C implemented executable.
    But if I load libHello1 via System.Load, the second lib is correctly loaded but the call back is not possible due to unresolved symbol.
    It seems like the symbols are not kept in this case(or the dlopen creates a different thread?...)
    The workaround to fix the issue is to link explicitely libHello1 to libHello2 when building libHello2.
    I don't know if this is clear to everyone so
    I have reproduced this on a very simple case.
    Basicaly, I have implemented in standard C language 2 shared libraries:
    libHelloModule1.so, libHelloModule2.so
    one standard executable and one java interface to call the method
    Below is the full code for reproduce:
    hello1.h:
    #include <dlfcn.h>
    #include <stdlib.h>
    #include <stdio.h>
    #include <iostream>
    #include <jni.h>
    #include "hello_jni.h" [u]//automatically generated by javah -- ref Makefile[/u]
    extern "C"  void hello_bug();
    hello1.cc :#include "hello1.h"
    extern "C" {
    JNIEXPORT void JNICALL Java_com_helloworld_Hello_ShowMessage
      (JNIEnv *, jobject, jstring){
    void *handle;
    const  char *error;
    void  (*init) (void);
    printf(" load Hello2 \n");
    handle = dlopen ("libHelloModule2.so", RTLD_LAZY);
    printf (" lib Hello2 onload.. \n");
    error = dlerror();
    if (!handle) {
          printf ("lib HelloModule2 not loaded correctly %s \n", error);
          exit(1);
       dlerror();
       init =(void(*)())  dlsym(handle, "hello2");
      error = dlerror();
            if(error)
                    fprintf(stderr, "Could not find print_hello(): %s\n",
    error);
                    exit(1);
    (*init)();
        dlclose(handle);
    void hello_bug()
    printf ("Hello bug correctly  invoked : CQFD\n");
    }// extern "C"
    hello2.cc
    #include "hello1.h"
    typedef void  ( *PF1) (char *, char *);
    extern "C" {
    void hello2(){
    printf ("Hello2 : ping Hello1\n");
    /*simple call work in c not via JNI*/
    hello_bug();
    Hello.java :
    package com.helloworld;
    import java.util.*;
    import java.io.*;
    public class Hello  {
      private native void ShowMessage(String msg);
      public void initialized() {
                System.out.println(" ShowMessage - called");
      try {
              ShowMessage("Generated with JNI");
           } catch (Exception e ) {
                e.printStackTrace();         }
      public Hello(){
      System.loadLibrary("HelloModule1");
                System.out.println(" HelloModule1 loaded");
    TestLocal.java :
    import java.util.*;
    import java.io.*;
    import com.helloworld.Hello;
    public class TestLocal{
    public TestLocal(){
            System.out.println("test local");
    public static void main(String[] args) {
            TestLocal test_local = new TestLocal();
            Hello test = new Hello();
            test.initialized();
    }THE MOST IMPORTANT IS IN THE MAKEFILE:
    Makefile :all: Hello.jar hello_jni.h libHelloModule1.so libHelloModule2.so TestLocal.class dummy
    Hello.jar: com/helloworld/Hello.class
    jar cvf $@  com/helloworld
    com/helloworld/Hello.class: Hello.java
    $(JAVAC)  -d . Hello.java
    hello_jni.h: Hello.jar
    $(JAVAH) -jni -o $@ -classpath ./Hello.jar com.helloworld.Hello
    libHelloModule1.so : hello_jni.h hello1.o  
    gcc  -G  -o $@ hello1.o -lstdc++
    libHelloModule2.so : hello2.o
    gcc   -G  -o $@ hello2.o -Wl -lstdc++  -L. -lHelloModule1   [u] # -->CASE  1 :THIS WORKS [/u]
    gcc   -G  -o $@ hello2.o -Wl -lstdc++ [u] #-->CASE 2 :THIS  DOES NOT WORK[/u]
    dummy : dummy_main.o
    gcc  -o $@ dummy_main.o -L. -lHelloModule1 -L/usr/local/lib -lstdc++
    hello2.o : hello2.cc
    gcc -I. -O -c  hello2.cc
    hello1.o : hello1.cc
    gcc -I. -O -c  hello1.cc
    TestLocal.class : TestLocal.java
    $(JAVAC) -classpath  . -d . TestLocal.java
    dummy_main.o :  dummy_main.cc
    gcc -I. -O -c  dummy_main.cc
    clean:
    rm -rf com *.o *.so *.class *.jar hello_jni.h dummyCASE 1 : libHelloModule1.so is explicitely linked to libHelloModule2
    myhost % dummy
    load Hello2
    lib Hello2 onload..
    Hello2 : ping Hello1
    Hello bug correctly invoked : CQFD
    myhost % java -cp . TestLocal
    test local
    HelloModule1 loaded
    ShowMessage - called
    load Hello2
    lib Hello2 onload..
    Hello2 : ping Hello1
    Hello bug correctly invoked : CQFD
    CASE 2 : libHelloModule1.so is not explicitely linked to libHelloModule2
    myhost % dummy
    load Hello2
    lib Hello2 onload..
    Hello2 : ping Hello1
    Hello bug correctly invoked : CQFD
    myhost % java -cp . TestLocal
    test local
    HelloModule1 loaded
    ShowMessage - called
    load Hello2
    lib Hello2 onload..
    lib HelloModule2 not loaded correctly ld.so.1: java: fatal: relocation error: file ./libHelloModule2.so: symbol hello_bug: referenced symbol not found
    My concern is to have this working in CASE1 with the JNI interface the same way it does in standard C built runtime.
    So does any have encountered this?
    Is there something I missed somewhere?
    Thanks lot for your help
    Youss

    Hi,
    I have implemented JNative which seems to be close to your problem.
    It works under Windows and Linux, and loads libraries via dlopen and dlsym.
    You can have a look at it's implementation at http://jnative.cvs.sourceforge.net/jnative/JNativeCpp/
    Don't forget to load your libraries before trying to call them with System.load("/path/to/your/lib.so"); if they are not referenced by LD_LIBRARY_PATH.
    This post may be false since I know nothing about Solaris. Perhaps JNative may be ported under Solaris ?
    --Marc (http://jnative.sf.net)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • 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

  • System.loadLibrary works in 1.3.1 but not in 1.2.2

    I Have a basic hello world application on Sun Solaris 7 that calls C++ from Java using JNI.
    The code works well on 1.3.1, but when I recompile it under 1.2.2 and run I get the following exception when I call System.loadLibrary to load my shared library:
    java.lang.UnsatisfiedLinkError: no MyLib in java.library.path
    My LD_LIBRARY_PATH is set correctly since it worked under 1.3.1.
    Just in case, I used the following code to get and set the java.library.path to no avail.
    // Check System properties
    String strLibPath = System.getProperty("java.library.path");
    System.out.println("The Lib Path before set == " + strLibPath);
    StringBuffer strLibPathBuffer = new StringBuffer("/u/kbonacc/mypath:");
    strLibPathBuffer.append(strLibPath);
    System.setProperty("java.library.path", strLibPathBuffer.toString());
    strLibPath = System.getProperty("java.library.path");
    System.out.println("The Lib Path after set == " + strLibPath);
    Are there any differences between 1.3.1 and 1.2.2 in this respect?
    Thanks,
    -- Ken

    In the bug parade I've heard excuses from Sun programmers that this is a read-only property and isn't supposed to be changed. It probably took them longer to write the reply to the bug than it would have to fix the code.
    I looked at the source code for the ClassLoader and for the source release of the JDK 1.3.1 and here's the code I found in the ClassLoader.loadLibrary() method:
            if (sys_paths == null) {
                    usr_paths = initializePath("java.library.path");
                    sys_paths = initializePath("sun.boot.library.path");
            }It seems it parses and caches the system and user library paths on startup and then never bothers to check them to see if they've changed ever again. I think it would be pretty simple to rewrite that code block by moving one line of code down two lines as this:
            if (sys_paths == null) {
                    sys_paths = initializePath("sun.boot.library.path");
            usr_paths = initializePath("java.library.path");I mean, it's not as if loadLibrary is really performance intensive or even critical enough to bother caching at all!
    This one code change could fix a lot of headaches.
    The particular headache I'm working on is that there doesn't seem to be any support in the Servlet 2.2 or 2.3 specification for JNI files. I'd really love to be able to use a directory like WEB-INF\jni to store libraries that need to be distributed with my web application. I tried to dynamically change java.library.path to include WEB-INF\jni, but alas I ran into the same problem you did, it doesn't work.
    Is is possible for this to be fixed, ever? I think it would take longer to say no and make up a reason why not then it would to actually make the fix... seems a good enough arguement to do it to me.
    And alternately, can we come up with a standard place to put JNI stuff for web applications in the next Servlet standards?
    Thanks in advance!
    -J.C.
    [email protected]

  • JNI System.loadLibrary troubles

    Hello again!
    I am so close to finishing this program I can taste it! But�
    OK, I am doing a bit of JNI. All appears to be well except my program can�t seem to use
    System.loadLibrary("myCPPdll");
    to find the dll file I need to run the C++ code.
    I�ve tired replacement with
    Runtime.getRuntime().loadLibrary("myCPPdll ");
    just for grins with the same result.
    I also tried
    System.loadLibrary("C:/fullPath/myCPPdll");
    with no luck.
    The error message I get, regardless if I run from the command line or via Eclipse is
    java.lang.UnsatisfiedLinkError: no myCPPdll in java.library.path.
    Possibly related: when I use the tutorial form
         Static
    System.loadLibrary("myCPPdll");
    my compiler tells me it can�t find the main. Just how critical is it to have it in this static format? It compiles great without the System call embedded in the static{} block!
    Thanks for your time!

    I added the .dll and get the same error. It was my
    understanding that System.loadLibrary(fileName)
    automatically added the file to the library path for
    the individual program in question. If this is not
    the case, could you please elaborate a bit on adding
    it to the path?
    No, in effect it searches the path to find the dll library. You need to (re-)read the tutorial -
    http://java.sun.com/docs/books/tutorial/native1.1/stepbystep/step5.html

  • Jni library loaded by System.load fails on later call to System.loadLibrary

    I'm attempting to use jnotify to listen for directory modifications. This requires using jni to dynamically link to a c library. I have gotten everything to work successfully if I put the library on the java.library.path. However, I would prefer to let my application specify the full path to the jnotify library. My understanding is that I should be able to do a System.load("/foo/libjnotify.so") in a static block and then subsequent calls to System.loadLibrary("jnotify") should do nothing as the library is already loaded. However I am getting a 'Exception in thread "main" java.lang.UnsatisfiedLinkError: no jnotify in java.library.path'. Am I misunderstanding the correct usage of these System calls?

    Joe wrote:
    That makes sense.
    The System.loadLibrary portion is in a 3rd party library which I am legally not allowed to change.
    Are there any other possible ways to accomplish the loading without the library being on the java.library.path?
    You have two problems - not one.
    The library itself is calling loadLibrary(). The standard idiom is that one does that in a static block. If a static block throws an exception, any exception, then the class will not load.
    Presumably the library is not checking for a duplicate library load. So your problem is that that loadLibrary() call must not throw an exception.
    Thus you cannot preload the library.
    Far as I can see you have the following options.
    - Put it on the path.
    - Create a jave exec handler (via Runtime.exec or jni), put the library on that path before you start another VM which does the real work.
    - Modify the java API loadLibrary() call so it catches the dup exception, that of course requires a boot option.

  • 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.

  • 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

  • System.loadLibrary in a package ?

    is it possible to call the System.loadLibrarymethod from a class that is in a package?
    when I tried to do the load from within the package, the librray was found, nut the functions in it weren't recognized.
    but when I removed the class from the package, it worked fine.
    my question: is it possible to return the class (with the System.loadLibrary method) back into the package?
    tnx

    tnx, but I'm not mixed upYes you are.
    Where you call loadLibrary does not matter. It does the same thing regardless of where you call it.
    >
    >
    any idea, how to solve this?
    Your problem is because the method signatures do not match.
    As suggested the most likely reason is because you did not regen and modify when the package changed. Next most likely reason is because you used javah incorrectly or you manually modified something in the signature that should not have.
    Lastly if you are using class loaders, it is possible that that could cause a problem (I haven't confirmed this however, and I consider it unlikely.)

  • Error with System.loadLibrary("msvcr80");

    Hi,
    I am trying to test a library somebody wrote and that library is using msvcr80.dll
    So in my little java test program goes like this:
    try {
         System.loadLibrary("advapi32");
         System.loadLibrary("msvcr80");
         // code removed for simplicity
    } catch (UnsatisfiedLinkError e) {
         System.err.println("Library failed to load.\n" + e);
    }But I always get an exception when trying to load msvcr80:
    Runtime Error!
    Program: C:\Program Files\Java\jre6\bin\javaw.exe
    R6034
    An application has made an attempt to load the C runtime library incorrectly.
    Please contact the application's support team for more information.
    What's the problem? The DLL can be found no problem (it's in the path pointed by java.library.path) but cannot be loaded. Is there another DLL that needs to be loaded beforehand besides advapi32?
    Thanks.

    Symbul wrote:
    Hi,
    Yes I know winsxs is not in the PATH, but I put it there just for test purposes. By the way I get the same C runtime javaw.exe error when I try to load ANY library that has a dependency on MSVCR80 (even microsoft DLLs, 3rd party JNI, etc.) and I'm not the only one in the office that has the problem either. Using Process Explorer I can see all the DLLs (every location) that are load by each applications and there is only one that's in memory and it's the correct one, so I'm quite puzzled as what could be wrong here.
    1. This is a JNI forum which this obviously is about.
    2. Please tell us what the problem is rather than asking why your solution doesn't work.
    3. Post the actual exception.
    4. And verify that you are NOT using windows 7, nor any 64 bit VM.
    Normally the MSVCR80 dll would be loaded dynamically by the OS when the reference of some other library requested it. In this case the most likely reason is because the dependent library (or some other) is not in the shared library path.

Maybe you are looking for

  • Please advise on Basis Certification

    Hi, I have a question from all the SAP Basis certified consultants, how many hours of study we require per day for passing the exam and how many times we need to go through the manuals. Please feel free to proivde tips of study which could be helpful

  • Solution needed for Blocked material problem

    Hi Guys, Scenario  :   There are two plants in a Location(Plant A & B) and a Customer.Now the Material is blocked  so that after the sales order the material will not be allowed to move from Plant A to B as well as the material will not be moved to t

  • Re: Of Netware6.0/ZEN3.2 and WinXP's Registry

    Yer not gonna believe it.. Another 'life lesson'! Delete %SYSTEM DRIVE%\NALCache and let NAL/NALEXPLD blow a new copy of all desired apps to your workstation! At least that seems to do it for me. Now why didn't I think of that before??? I'm gettin' o

  • Reboot of DR server

    HI I am posting this to get some feedback on the work i am doing. Linux guys are doing some O/S patching and they will be rebooting the server . I've few DR database on it ( I need to shutdown the DB's before the O/S patching ) . whats the necessary

  • Itune 5 hates quicktime 7

    hi I have been trying to update my itune 4 with the 5.01 . but once installed it does not open cos it says quicktime 7 is required. so i go to quitime update (version 6.5) and it says it is already the latest. so i go to download site directly for qu