Debugging a JNI dll

Hello,
anyone have any clues on how to debug a JNI dll from visual studio? Just attach to the Java process in question, and place your breakpoint?
Regards,
Helge Fredriksen

1. Open your DLL project in VS, and set breakpoints as you need them
2. Search the VS settings for one which is the "calling program". Make the calling program java.exe.
3. Supply commandline parameters to be passed to java.exe, such that the JVM runs your java program.

Similar Messages

  • Debugging a JNI DLL created with Visual C++

    Hello.
    Due to the necessary libraries, I need to create a DLL in Visual C++ to be called from my Java class:
    System.loadLibrary("my_dll_name");
    But I've got a problem: I'm newbie in Visual C++ and I would like to debug the DLL, so when I press F5 (Go for Debug mode), I get the message "Please specify the executable file". Obviously, I've got a DLL, not an .exe or .com file.
    I would be extremely obliged if anybody could share any experience.
    Thank you very much.

    What you nee to do is this:
    Run your java app (in an IDE if poss.) and have it pause at some point (if its a command line app., wait for a key, if its a Swing app, you're ok, just wait for the app. to appear. Now start VC6 and go
    menus:
    Build/StartDebug/Attach to process. Ther should be one process calleed java. Attach to that. If your DLL has debug info in it, you should be able to navigae to the source and set breakpoints etc.
    Alternativly, you could just put OutputDebugString(...) (this is a Win32 function) statements in your DLL and use DBMON.EXE (from the win32 SDK) to look at the output.

  • Debugging Jni Dll with VC6

    I'm having problems debugging my JNI DLL hosted by a tomcat application. Starting Tomcat under the vc debugger causes a lot of first chance exceptions (0c0000005) to be thrown by JVM.DLL. This happens before my jni dll is even loaded, here's a short dump :
    Nicht abgefangene Ausnahme in java.exe (JVM.DLL): 0xC0000005: Access Violation.
    Nicht abgefangene Ausnahme in java.exe (JVM.DLL): 0xC0000005: Access Violation.
    Nicht abgefangene Ausnahme in java.exe (JVM.DLL): 0xC0000005: Access Violation.
    Nicht abgefangene Ausnahme in java.exe (JVM.DLL): 0xC0000005: Access Violation.
    Nicht abgefangene Ausnahme in java.exe (JVM.DLL): 0xC0000005: Access Violation.
    Nicht abgefangene Ausnahme in java.exe (JVM.DLL): 0xC0000005: Access Violation.
    Geladene Symbole für "D:\Projekte\Applications\Winlog.web\tomcat\bin\JGimp.dll" überein. <----- my JNI DLL
    Nicht abgefangene Ausnahme in java.exe (JVM.DLL): 0xC0000005: Access Violation.
    Geladene Symbole für "D:\Projekte\Applications\Winlog.web\tomcat\bin\CGimp.dll"
    JVM seems to catch those itself, but needless to say, this is something that shouldn't happen.
    Any ideas ?
    Regards

    805541 wrote:
    Actually, this was a statement waiting for opinions...
    I can use VC2005, VC2008, WinDebug as well, same issue.
    And the real alternative is to have strict layering in the C code itself such that you shouldn't need to debug JNI itself at all.well, that's a strange comment. Is there any valid reason not to debug a jni DLL ?1. Because you can't. Say on a production system with strict install rules.
    2. Because you don't actually need to "debug" the JNI code itself because you maintain a strict boundary layer protocol. Thus bugs can normally only be expected in the functional C code (which allows for testing via other means.)
    3. Because it is difficult to do.
    And my favorite is because I would avoid JNI completely these days and instead use a separate executable that wraps the target functionality. Thus to discrete applications both which can be tested independently.
    When I used JNI in the past I never needed to use a debugger (because I followed item 2 in the above.)
    Other than that I can only see that you have two questions.
    1. You are asking if you are doing something wrong. You might suggest googling.
    2. You know you are not doing anything wrong and there is something 'wrong' with the VM. In that case get use to it. It isn't going away. Or at least not unless you have a sales contract and/or service contract with Sun/Oracle. And if you have that then this is site is not the appropriate way to use that.

  • UnsatisfiedLinkError for JNI DLL compiled with vs2008 express

    I am trying to create a JNI DLL using Visual Studio 2008 Express.
    I have read several places where -MD causes JNI problems but from what I've read, I need this option to create the DLL properly.
    The DLL does get built cleanly and I have created a simple C application (obviously not calling the JNI functions themselves but the other functions that are in the DLL). This application runs with no problems.
    As soon as I try to use the DLL with JNI, I get an UnsatisfiedLinkError: Can't find dependent libraries.
    I have used Dependency Walker on the C application I created and it finds no errors; however, if I run it on the DLL itself, it does report an error trying to find msvcr90.dll which is in the winsxs directory under c:\windows so I assume this is the problem dependency.
    I am running this on the same computer that has Visual Studio 2008 Express SP1 installed. This is a Windows XP Service Pack 3 computer running JDK 1.6.0_14.
    Any help would be greatly appreciated.
    Thanks

    Right or wrong, I include some library files into my link statement (it's the only way I could find to clear up your question). I link in some standard window libraries as well as some of my own DLL whose functions are used by this DLL. I use a makefile to build my code.
    Here is a compile statement and the link statement for my DLL:
    cl.exe -I c:\progra~1\micros~1.0\vc\include -I c:\progra~1\mi2578~1\windows\v7.0\include -I c:/progra~1/java/jdk1.6.0_14/include -I c:/progra~1/java/jdk1.6.0_14/include/Win32 -I S:/wlw/Develop/Src/Include -I S:/wlw/Products/Src/Include -I S:/wlw/Products/Src/Include -I S:/wlw/Products/Src/LibSrc/RTA/Client/Include/Example -I S:/wlw/Products/Src/LibSrc/RTA/Client/Include/System -I S:/wlw/Products/Src/LibSrc/RTA/Client/Include/User -I S:/wlw/Products/Src/LibSrc/RTA/Server/Include/System -I S:/wlw/Products/Src/LibSrc/RTA/Server/Include/User -DRTA_DLL -D_BIND_TO_CURRENT_VCLIBS_VERSION -Zp4 -DWIN32 -D__WIN32__ -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 -D_USE_32BIT_TIME_T -D_CRT_SECURE_NO_WARNINGS -nologo -W3 -Od -EHsc -MD -Z7 -c buildDate.c
    link.exe -incremental:no -nologo -debug kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib -dll -out:S:/wlw/Products/Obj/Win32/Lib/rta.dll -implib:S:/wlw/Products/Obj/Win32/Lib/rta.lib eipc_client.obj eipc_usersys.obj eips_pccc.obj eips_cnxn.obj eips_cpf.obj eips_encap.obj eips_iomsg.obj eips_rtasys.obj eips_timer.obj rta_utils.obj eips_userdf1.obj eips_userobj.obj eips_usersock.obj eips_usersys.obj jniRta.obj jniRtaPlc.obj jniRtaPlcAddress.obj qcRta.obj qcRtaPlcAddressLink.obj qcRtaPlcLink.obj qcRtaProcess.obj qcRtaRead.obj qcRtaSlcRead.obj qcRtaSlcWrite.obj qcRtaState.obj qcRtaTimer.obj qcRtaWrite.obj Q:/Develop/Obj/Win32/Lib/tcpipNet.lib Q:/Develop/Obj/Win32/Lib/linkList.lib Q:/Develop/Obj/Win32/Lib/stdUtils.lib buildDate.obj
    mt -manifest S:/wlw/Products/Obj/Win32/Lib/rta.dll.manifest -outputresource:S:/wlw/Products/Obj/Win32/Lib/rta.dll;2

  • Debugging in a dll on another computer, in another folder.

    Hi,
    I have a dll which was produced with VisualStudio2008, as console app. I have on that PC (let's say DevPC ):
    C:\DevLoc\IntAd.cpp (dll source file)
    C:\DevLoc\IntAd.dll
    C:\DevLoc\IntAd.pdb (symbol file)
    This dll is used also on another computer (let's say AppPC), in another folder (let's say AppLoc). In order to be able to debug in the dll on AppPC using VisualStudio I had to put there also the pdb file (but in original folder) and the source file in
    the AppLoc so I have there:
    C:\AppLoc\IntAd.dll
    C:\AppLoc\IntAd.cpp
    C:\DevLoc\IntAd.pdb
    This works but then if put on AppPC the source file also in the original location (so I have it in both) like:
    C:\DevLoc\IntAd.cpp
    the debugger will prefer this one, will enter this one at run time. Strangely, VisualStudio debugger is "smart" (with or without quotes) enough that if I open C:\AppLoc\IntAd.cpp and try to put at run time a breakpoint inside, will automatically
    open C:\DevLoc\IntAd.cpp and put the breakpoint there. The problem is that the two source file(s) might be different versions.
    Now come the questions and they might seem like XY questions but I'm interested what options I have and how each one can be achieved:
    1) What can I do so in the IntAd.dll is embedded not absolute but relative path to the IntAd.pdb so I can put the symbol file in the same folder as the dll file?
    2) How can I modify IntAd.dll (I mean really to edit the dll file) to change the pdb path embedded in it? This way I could put the pdb in whatever folder I want on the AppPC. A dirty solution I thought was to edit the file and to change the pdb path and
    to pad with trailing spaces that pdb fully qualified name to match the original name length. This, of course, assuming that new name is shorter than original name (to ensure that, on DevPC I should chose a ridiculous long directory name). Would this work?
    3) Why is C:\DevLoc\IntAd.cpp prefered by debugger instead C:\AppLoc\IntAd.cpp if both exists? What can I do against?
    Thanks

    @  MaybeCompletelyW: If I set the symbol path, this means that also on DevPC that path will be used, is still a fixed path. The thing is that I need a portable package, so I can deploy the three files (cpp, dll, pdb) in the same folder, whichever
    it is. The problem is that the dll is deployed on several AppPC's, on each one in another folder, on each one could be another version and I need to be able to debug in the dll on each AppPC without rebuilding the dll there. I thought about setting symbol
    path like $(PathFromSysVar)\IntAd.pdb but it seems to me that in dll file the path is still explicit and full.

  • Debugging a vc dll from the diadem?

    Hi all,
      I want to debug a vc dll that is  being used in the diadem script. I Have registered the dll in the diadem. My primary aim is to debug the vc++ code from the diadem once the function in the vc dll is occured in the diadem script. My version of diadem is 9.1 and vc is 6. I have given the target application in the visual studio to be diadem and tried running  in the debug but the debug is not going in to the vc code.
    If some one have encountered the same before let me know the steps in doing this process. The dll i'm using is a GPI extension DLL
    With regards,
    SKB
    Message Edited by dragnov on 09-16-2009 04:02 AM
    Solved!
    Go to Solution.

    Hello SKB!
    I did this - the same way you did - for a long time without any problem. The only thing I can imagine is that the VC output DLL ist not the DLL you load in DIAdem. In a standard configuration the DLL debug version will be in the 'debug' directory of your project. In DIAdem this DLL must be registered. To be 100% confident you can use the tool 'Process Monitor' from SysInternals to view all DLLs loaded by DIAdem. If you check this just run your script in DIAdem first because DIAdem loads the DLLs on demand.
    Matthias
    Matthias Alleweldt
    Project Engineer / Projektingenieur
    Twigeater?  

  • Jdev crash when loading JNI dll

    Greetings:
    I have the following msg when I either
    click in "Design" tab or start debugger:
    -------------- cut here -------------
    JniPortal for D:\JDeveloper\java1.2\jre\bin\OJVM\jvm.dll reported
    Native Library D:\JDeveloper\java1.2\bin\JTACCDLL.dll already loaded in another classloader
    java.lang.UnsatisfiedLinkError: Native Library D:\JDeveloper\java1.2\bin\JTACCDLL.dll already loaded in another classloader
    void java.lang.ClassLoader.resolveClass0(java.lang.Class)
    void java.lang.ClassLoader.resolveClass(java.lang.Class)
    java.lang.Class borland.jbuilder.jot.JotClassLoader.loadClass(java.lang.String, boolean)
    java.lang.Class borland.jbuilder.jot.ClassManager.loadClass(java.lang.String, boolean)
    java.lang.Class borland.jbuilder.jot.JotPackageManager.loadClass(java.lang.String, boolean)
    int borland.jbuilder.uidesigner.$491.getType(borland.jbuilder.cmt.CmtSubcomponent, borland.jbuilder.cmt.CmtComponents)
    com.objectspace.jgl.Array borland.jbuilder.uidesigner.$491.$TGb(borland.jbuilder.cmt.CmtComponents, borland.jbuilder.cmt.CmtComponent, borland.jbuilder.cmt.CmtMethodSource)
    void borland.jbuilder.uidesigner.DesignerAddin.annotate(borland.jbuilder.cmt.CmtComponentModel, borland.jbuilder.cmt.CmtComponents)
    void borland.jbuilder.designer.DesignerManager.annotate(borland.jbuilder.cmt.CmtComponents, borland.jbuilder.cmt.CmtComponentModel)
    void borland.jbuilder.designer.DesignContext.open(borland.jbuilder.addin.Url, boolean)
    void borland.jbuilder.designer.DesignContext.changeUrl(borland.jbuilder.addin.Url)
    void oracle.jdeveloper.addin.impl.JavaMasterViewerImpl.changeViewerUrl(java.lang.String)
    void oracle.jdeveloper.addin.CustomViewer.changeUrl(java.lang.String)
    void oracle.jdeveloper.addin.JavaMasterViewer_JavaDispatch.invoke(int, borland.javaport.JavaCallStack)
    The jtaccdll.dll is my JNI dll. I am not sure
    why is it tryin to load when I launch "Design". The dll has nothing to do with
    screen objects.
    Before I put it in that place JDev was
    complaining that the dll is missing and
    refused to do anything (run debugger at all).
    Did anybody figured how to fix it? JDev
    is v3.1.1.2.
    TIA,
    V.
    null

    jasro wrote:
    Could you elaborate a little bit? Maybe provide an example? How exactly should I rename the jni wrapper functions?1. Run javah again.
    2. Verify that the signatures in the h file match those in the c/cpp file.
    3. Include the h file in the c/cpp file.

  • To add the JNI dll to the jar file and use the dll inside the jar file

    Hi to everybody,
    I am new to java.
    I want to add the JNI dll to the jar file and use it in the java class.
    How can I achieve it.
    Please help me.
    Thanks in advance.
    Regards,
    M.Sivadhas.

    can't be done because none of the known operating systems support reading binary libraries from .jar files ... you can add the binary to the jar but then you have to extract it...
    besides, mixing platform specific and platfrom independent components is not a very good idea, i'd keep the dll out of the jar to begin with

  • Debugging using JNI

    I'm currently trying to figure out how to debug the code in the java end of a C++ program invoking the javaVM. I've used the:
    java -Xdebug -Xnoagent-Djava.compiler=none -runjdwp:transport=dt_socket,server=y,suspend=y InvokeTest
    command to run a class called InvokeTest and have successfully been able to link Eclipse's debugger to the jvm and it works perfectly.
    As far as actually invoking a method in my InvokeTest, from C++, I've had no problems. But as soon as I add the: options[4].optionString = "-Xrunjdwp:transport=dt_socket,server=y,suspend=n" argument to the options the JavaVm can not be created (CreateJavaVM returns -3)
    Does anybody know how to properly get Xrunjwp running through JNI?
    I've included the code I'm using to invoke the javaVM below:
    int JavaManager::initializeJava ()
         JavaVMInitArgs args;
         JavaVMOption options[4];
         int retval = 0;
         CreateJavaVM_t *CreateJavaVM;
         HINSTANCE handle;
         /* Load the Java VM DLL */
         if ((handle = LoadLibrary("d:\\j2sdk1.4.2\\jre\\bin\\client\\jvm.dll")) == NULL)
              printf("Error:cannot load JVM");
              return NULL;
         /* Now get the function addresses */
         CreateJavaVM = (CreateJavaVM_t *)GetProcAddress(handle, "JNI_CreateJavaVM");
         if (CreateJavaVM == NULL)
              printf("Error: can't find JNI interfaces\n");
              return NULL;
         args.version = JNI_VERSION_1_4;
         args.nOptions = 5;
         options[0].optionString = "-Djava.class.path=D:\\Programming Projects\\callingJavaFromC\\java";
         options[1].optionString = "-Xdebug";
         options[2].optionString = "-Xnoagent";
         options[3].optionString = "-Djava.compiler=none";
         //why is this causing the CreateJavaVM to return -3?
         options[4].optionString = "-Xrunjdwp:transport=dt_socket,server=y,suspend=n";
         args.options = options;
         args.ignoreUnrecognized = JNI_FALSE;
         retval = CreateJavaVM(&jvm, (void **)&env, &args);
         if(retval != 0)
              printf("Error: cannot create JVM\n");
              printf("error num = %d\n", retval);
              isInitialized = false;
              return -1;
         return 0;
    }Thanks for your time,
    Corry Trout

    The problem is the dimension of your option array. Your allocate an array with size 4.
    JavaVMOption options[4];
    But then you assign a value to the 5th position.
    options[4].optionString = "-Xrunjdwp:transport=dt_socket,server=y,suspend=n";
    If you correct the array size to 5 it shouldn't crash anymore.
    I'm working on the same problem. I also want to debug the java code with a remote java debugger. But I can't connect with the debugger if i launch the jvm from my own exe. If you can do that now, please let me know...
    Markus Moos

  • Using a dll in the JNI dll defined

    Hello,
    I'm new to JNI and I have managed to compile and run a simple Hello world program, now this is my problem:
    The C++ code I'm using need to make calls to some dlls (msado15.dll and cdoex.dl) so that I have a function doing this (I have tested the function in pure C++ and it works):
    #import "msado15.dll" no_namespace rename("EOF","adoEOF")
    #import "cdoex.dll" no_namespace
    * Class: AdaptorNative
    * Method: login
    * Signature: (Ljava/lang/String;)V
    JNIEXPORT void JNICALL Java_AdaptorNative_login
    (JNIEnv *env, jobject obj_this, jstring userId)
         printf("login\n");
         // Try to retrieve a pointer on a Connection object     
    ConnectionPtr conn(_uuidof(Connection));
    When I try to call the function in my JAVA code and run it, I have the following error:
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : unknown exception code occurred at PC=0x77e7f142
    Function name=RaiseException
    Library=C:\WINNT\system32\KERNEL32.DLL
    Could anyone please help me? I have tried to include the path of the msado.dll and cdoex.dll in the java.library.path but it does not change anything.
    Thanks
    Tanguy

    Thanks for replying but this does not seem to work.
    * I have set the path to this libraries in the PATH and LIBPATH environment variables. (I'm on windows 2000 Server)
    * I have loaded explicitly the library
    * I have set the java.library.path variable in the VM to: .;paths to dlls
    and I have still the same error except that now in the list of loaded libraries they seem to be loaded:
    Dynamic libraries:
    0x08DB0000 - 0x08DBD000 C:\SyncExchangeNative\syncmlclient_dbadaptor_SyncExchangeAdaptor.dll
    0x620B0000 - 0x62460000      C:\Program Files\Fichiers communs\Microsoft Shared\CDO\cdoex.dll
    0x1F440000 - 0x1F4B7000      C:\Program Files\Fichiers communs\System\ado\msado15.dll
    I do not know if this is important but the msado.dll and cdoex.dll liberaries are for COM objects. They seem to define tlh and tld files.
    I'm really desperate to find an answer with this... Please help me!
    Thanks a lot
    Tanguy

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

  • Is it possible to call a non-JNI DLL

    I have a DLL I'd like to execute from Java, but do not have access to the source. From what I've read about JNI, it seems it requires Java specific code in the DLL source. Is there any other option? I need to pass it a String and it returns a String. Is Runtime.exec a viable option?
    Any advice would be greatly appreciated.

    OK... here is a scenario with some code snippets. I've done this with a C/C++ dll on windows....so if ur on some other OS you'll have to make appropriate changes(ditto for DELPHI).
    I have a dll called "myold.dll" written in C/C++ which has the following function signature
    int getVersion();
    My purpose is to call this function in the dll using JNI.
    For this you will need
    1. Header file of myold.dll (say myold.h)
    2. .lib file for myold.dll (say myold.lib)
    Now, write a java file "Mynative.java"
    public class Mynative {
    public native int getVersion();
       static {
          System.loadLibrary("Mynative"); //matches name of  new dll you are about to create
       public static void main(String[] args){
          Mynative nativity = new Mynative();
          int version = nativity.getVersion();
          System.out.println(version);
    }after compiling the above code, you will need to run javah
    on the resulting class file
    javah -jni Mynative
    Now you will have a header file Mynative.h which looks like
    /* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class Mynative */
    #ifndef IncludedMynative
    #define IncludedMynative
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class: Mynative
    * Method: getVersion
    * Signature: ()I
    JNIEXPORT jint JNICALL Java_Mynative_getVersion
    (JNIEnv *, jobject);
    #ifdef __cplusplus
    #endif
    #endif
    Now create a C file say myCfile.c as follows
    #include <jni.h>
    #include "Mynative.h"
    #include <stdio.h>
    #include "windows.h"
    #include "myold.h" //Header file of the existing dll..you need this file!!
    JNIEXPORT jint JNICALL
    Java_Mynative_getVersion(JNIEnv *env, jobject obj)
    jint myInt;
    /* Call native function in Mynative.dll */
    myInt = getVersion();
    printf(myInt);
    printf("\n");
    return myInt;
    Now compile this file using a C compiler to create "mynative.dll".You'll have to know how to do that using whatever C/C++ compiler you use.
    This dll should be in any folder thats on the Java Classpath or else you are going to get an error.
    Well..you're set. You can run the java file and see the output.
    If however you do not have the header file for myold.dll, then you'll have to know how to dynamically load a dll in C/C++. Unfortunately, i don't know how so u'll have to ask someone else.
    Hope my efforts here don't go wasted. Good luck
    Vinny.

  • JNI DLL on Windows XP crashes when lots of memory is available.

    I'm using the RXTX COMM jar/DLL for Windows XP (replacement for javax.comm API) from:
    http://www.rxtx.org/
    This uses JNI to talk to the Windows SerialPort/COM devices.
    When I use the stock binaries from the developer (built with GCC 2.95), they seem to work in all situations I test them.
    For a couple of reasons, I need to rebuild these libraries. I have a MinGW/MSYS environment with the current GCC release (gcc 3.4.2 (mingw-special)) and everything built fine with the provided makefiles.
    However, when I run some small tests with the resulting dll's, I seem some really weird behavior when i vary the Xms and Xmx value. I'm using Sun's JVM, 1.5.0_07.
    Using the default min/max: 2/64, everything works OK.
    But If I use 32/128, I get a JVM crash.
    If I set min/max to 128/128, it works.
    If I set min/max to 128/129, it crashes.
    It's almost as if when there is more memory available, then the JVM puts the DLL is put in a location that maybe is too "far" away. But AFAICT, there is no option to GCC for near/far calls on X86.
    In any case, I'm hoping someone has seen something like this before.
    Thanks,
    Pete

    FYI, here is the crash I get (hs_err_pid####.log)
    # An unexpected error has been detected by HotSpot Virtual Machine:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6d7d6fec, pid=4972, tid=3956
    # Java VM: Java HotSpot(TM) Client VM (1.5.0_07-b03 mixed mode)
    # Problematic frame:
    # V [jvm.dll+0x116fec]
    --------------- T H R E A D ---------------
    Current thread (0x0fd23458): JavaThread "Thread-5" [_thread_in_vm, id=3956]
    siginfo: ExceptionCode=0xc0000005, reading address 0x1034a2d1
    Registers:
    EAX=0x1034a2d1, EBX=0x0baccac0, ECX=0x0000deab, EDX=0x6d811570
    ESP=0x1118f31c, EBP=0x1118f320, ESI=0x00000000, EDI=0x00000000
    EIP=0x6d7d6fec, EFLAGS=0x00010246
    Top of Stack: (sp=0x1118f31c)
    0x1118f31c: 0fd23458 1118f390 6d796650 1034a2d1
    0x1118f32c: 0fd23458 0fd23458 0baccac0 6d746708
    0x1118f33c: 1034a2d1 0fd23458 0fd23458 6d74e589
    0x1118f34c: 1034a2d1 0fd23458 0fd23458 00000006
    0x1118f35c: 0fd23518 0fd23458 0baccac0 00f6826f
    0x1118f36c: 0fd23518 1034a2d1 1118f374 0baccac0
    0x1118f37c: 1118f39c 0baccd10 00000000 0baccac0
    0x1118f38c: 1118f3a0 1118f3bc 00f629fa 0bacccb8
    Instructions: (pc=0x6d7d6fec)
    0x6d7d6fdc: 7c e9 8b c6 5e c9 c3 55 8b ec 8b 45 08 56 33 f6
    0x6d7d6fec: 80 38 00 74 0f 8d 4d 0a 46 51 50 e8 cf fe ff ff
    Stack: [0x11090000,0x11190000), sp=0x1118f31c, free space=1020k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    V [jvm.dll+0x116fec]
    V [jvm.dll+0xd6650]
    j gnu.io.RXTXCommDriver.<clinit>()V+9
    v ~StubRoutines::call_stub
    V [jvm.dll+0x86401]
    V [jvm.dll+0xdb172]
    V [jvm.dll+0x862d2]
    V [jvm.dll+0x78dbf]
    V [jvm.dll+0x77ca8]
    V [jvm.dll+0xa3657]
    V [jvm.dll+0x9ca03]
    C [java.dll+0x13d8]
    j java.lang.Class.forName0(Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class;+0
    j java.lang.Class.forName(Ljava/lang/String;)Ljava/lang/Class;+5
    j gnu.io.CommPortIdentifier.<clinit>()V+12
    v ~StubRoutines::call_stub
    V [jvm.dll+0x86401]
    V [jvm.dll+0xdb172]
    V [jvm.dll+0x862d2]
    V [jvm.dll+0x78dbf]
    V [jvm.dll+0x77ca8]
    V [jvm.dll+0xc6987]
    V [jvm.dll+0xc7624]
    V [jvm.dll+0xc750a]
    V [jvm.dll+0x81ae1]
    j com.foo.serial.SerialConnection.findTargetPort()Lgnu/io/CommPortIdentifier;+13
    j com.foo.serial.SerialConnection.run()V+33
    v ~StubRoutines::call_stub
    V [jvm.dll+0x86401]
    V [jvm.dll+0xdb172]
    V [jvm.dll+0x862d2]
    V [jvm.dll+0x8602f]
    V [jvm.dll+0xa0bcb]
    V [jvm.dll+0x10bdad]
    V [jvm.dll+0x10bd7b]
    C [msvcrt.dll+0x2a3b0]
    C [kernel32.dll+0xb683]
    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j gnu.io.RXTXVersion.nativeGetVersion()Ljava/lang/String;+0
    j gnu.io.RXTXCommDriver.<clinit>()V+9
    v ~StubRoutines::call_stub
    j java.lang.Class.forName0(Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class;+0
    j java.lang.Class.forName(Ljava/lang/String;)Ljava/lang/Class;+5
    j gnu.io.CommPortIdentifier.<clinit>()V+12
    v ~StubRoutines::call_stub
    j com.foo.serial.SerialConnection.findTargetPort()Lgnu/io/CommPortIdentifier;+13
    j com.foo.serial.SerialConnection.run()V+33
    v ~StubRoutines::call_stub
    --------------- P R O C E S S ---------------
    Java Threads: ( => current thread )
    0x0fd2e630 JavaThread "Thread-8" [_thread_blocked, id=3672]
    0x0fd304e0 JavaThread "Thread-7" [_thread_blocked, id=4076]
    =>0x0fd23458 JavaThread "Thread-5" [_thread_in_vm, id=3956]
    0x0fd0b568 JavaThread "Image Fetcher 3" daemon [_thread_blocked, id=5632]
    0x0fc498a8 JavaThread "Image Fetcher 2" daemon [_thread_blocked, id=5364]
    0x0fc4fbc0 JavaThread "Image Fetcher 1" daemon [_thread_blocked, id=672]
    0x0fc235a0 JavaThread "Image Fetcher 0" daemon [_thread_blocked, id=4204]
    0x0fcead48 JavaThread "Thread-3" [_thread_in_native, id=5500]
    0x0fc244c0 JavaThread "Thread-2" [_thread_blocked, id=5772]
    0x0fc346f0 JavaThread "TimerQueue" daemon [_thread_blocked, id=676]
    0x0fc07a60 JavaThread "AWT-EventQueue-0" [_thread_in_native, id=2268]
    0x0fda0660 JavaThread "AWT-Shutdown" [_thread_blocked, id=3200]
    0x0fd57ee8 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=184]
    0x0fd77730 JavaThread "AWT-Windows" daemon [_thread_in_native, id=3204]
    0x0f922780 JavaThread "Reader thread console tty" [_thread_in_native, id=5052]
    0x0f91f220 JavaThread "console tty" [_thread_blocked, id=2676]
    0x00326fe8 JavaThread "DestroyJavaVM" [_thread_blocked, id=3632]
    0x0f91fbd8 JavaThread "startlevel job thread" [_thread_blocked, id=2192]
    0x00f22e78 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=4580]
    0x00f21ae8 JavaThread "CompilerThread0" daemon [_thread_blocked, id=1552]
    0x00f20f28 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=4080]
    0x00f17ce8 JavaThread "Finalizer" daemon [_thread_blocked, id=3124]
    0x00f16850 JavaThread "Reference Handler" daemon [_thread_blocked, id=5552]
    Other Threads:
    0x00ed8a88 VMThread [id=1964]
    0x00f20dd0 WatcherThread [id=3724]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    def new generation total 9088K, used 5454K [0x02f60000, 0x03930000, 0x03960000)
    eden space 8128K, 55% used [0x02f60000, 0x033c3960, 0x03750000)
    from space 960K, 99% used [0x03840000, 0x0392fff8, 0x03930000)
    to space 960K, 0% used [0x03750000, 0x03750000, 0x03840000)
    tenured generation total 121024K, used 125K [0x03960000, 0x0af90000, 0x0b160000)
    the space 121024K, 0% used [0x03960000, 0x0397f718, 0x0397f800, 0x0af90000)
    compacting perm gen total 9728K, used 9657K [0x0b160000, 0x0bae0000, 0x0f160000)
    the space 9728K, 99% used [0x0b160000, 0x0bace720, 0x0bace800, 0x0bae0000)
    No shared spaces configured.
    Dynamic libraries:
    0x00400000 - 0x0042f000      C:\dev\prgm_SerialTest\output\run.exe
    0x7c900000 - 0x7c9b0000      C:\WINDOWS\system32\ntdll.dll
    0x7c800000 - 0x7c8f4000      C:\WINDOWS\system32\kernel32.dll
    0x77dd0000 - 0x77e6b000      C:\WINDOWS\system32\ADVAPI32.DLL
    0x77e70000 - 0x77f01000      C:\WINDOWS\system32\RPCRT4.dll
    0x71ad0000 - 0x71ad9000      C:\WINDOWS\system32\WSOCK32.DLL
    0x71ab0000 - 0x71ac7000      C:\WINDOWS\system32\WS2_32.dll
    0x77c10000 - 0x77c68000      C:\WINDOWS\system32\msvcrt.dll
    0x71aa0000 - 0x71aa8000      C:\WINDOWS\system32\WS2HELP.dll
    0x77d40000 - 0x77dd0000      C:\WINDOWS\system32\USER32.DLL
    0x77f10000 - 0x77f57000      C:\WINDOWS\system32\GDI32.dll
    0x6d6c0000 - 0x6d857000      C:\dev\prgm_SerialTest\output\jre\bin\client\jvm.dll
    0x76b40000 - 0x76b6d000      C:\WINDOWS\system32\WINMM.dll
    0x6d280000 - 0x6d288000      C:\dev\prgm_SerialTest\output\jre\bin\hpi.dll
    0x76bf0000 - 0x76bfb000      C:\WINDOWS\system32\PSAPI.DLL
    0x6d690000 - 0x6d69c000      C:\dev\prgm_SerialTest\output\jre\bin\verify.dll
    0x6d300000 - 0x6d31d000      C:\dev\prgm_SerialTest\output\jre\bin\java.dll
    0x6d6b0000 - 0x6d6bf000      C:\dev\prgm_SerialTest\output\jre\bin\zip.dll
    0x6d4c0000 - 0x6d4d3000      C:\dev\prgm_SerialTest\output\jre\bin\net.dll
    0x6d4e0000 - 0x6d4e9000      C:\dev\prgm_SerialTest\output\jre\bin\nio.dll
    0x6d000000 - 0x6d167000      C:\dev\prgm_SerialTest\output\jre\bin\awt.dll
    0x73000000 - 0x73026000      C:\WINDOWS\system32\WINSPOOL.DRV
    0x76390000 - 0x763ad000      C:\WINDOWS\system32\IMM32.dll
    0x774e0000 - 0x7761d000      C:\WINDOWS\system32\ole32.dll
    0x73760000 - 0x737a9000      C:\WINDOWS\system32\ddraw.dll
    0x73bc0000 - 0x73bc6000      C:\WINDOWS\system32\DCIMAN32.dll
    0x73940000 - 0x73a10000      C:\WINDOWS\system32\D3DIM700.DLL
    0x74720000 - 0x7476b000      C:\WINDOWS\system32\MSCTF.dll
    0x7c9c0000 - 0x7d1d5000      C:\WINDOWS\system32\shell32.dll
    0x77f60000 - 0x77fd6000      C:\WINDOWS\system32\SHLWAPI.dll
    0x773d0000 - 0x774d2000      C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll
    0x5d090000 - 0x5d127000      C:\WINDOWS\system32\comctl32.dll
    0x6d240000 - 0x6d27f000      C:\dev\prgm_SerialTest\output\jre\bin\fontmanager.dll
    0x71a50000 - 0x71a8f000      C:\WINDOWS\System32\mswsock.dll
    0x76f20000 - 0x76f47000      C:\WINDOWS\system32\DNSAPI.dll
    0x76fb0000 - 0x76fb8000      C:\WINDOWS\System32\winrnr.dll
    0x76f60000 - 0x76f8c000      C:\WINDOWS\system32\WLDAP32.dll
    0x76fc0000 - 0x76fc6000      C:\WINDOWS\system32\rasadhlp.dll
    0x662b0000 - 0x66308000      C:\WINDOWS\system32\hnetcfg.dll
    0x71a90000 - 0x71a98000      C:\WINDOWS\System32\wshtcpip.dll
    0x605d0000 - 0x605d9000      C:\WINDOWS\system32\mslbui.dll
    0x77120000 - 0x771ac000      C:\WINDOWS\system32\OLEAUT32.DLL
    0x101a0000 - 0x101b0000      C:\dev\prgm_SerialTest\output\jre\bin\rxtxSerial.dll
    0x73d90000 - 0x73db7000      C:\WINDOWS\system32\crtdll.dll
    VM Arguments:
    jvm_args: -Djava.util.logging.config.file=config/logging.properties -Xms128m -Xmx129m -Dlauncher.config.params=-Djava.util.logging.config.file=config/logging.properties
    -Xms128m
    -Xmx129m -Dlauncher.config.classpath=C:\dev\prgm_SerialTest\output\run.exe;C:\dev\prgm_SerialTest\output\libraries\commons-net-1.4.1.jar;C:\dev\prgm_SerialTest\output\libraries\core_util.jar;C:\dev\prgm_SerialTest\output\libraries\kxml.jar;C:\dev\prgm_SerialTest\output\libraries\osgi.jar;C:\dev\prgm_SerialTest\output\libraries\substance-button-shaper-pack.jar;C:\dev\prgm_SerialTest\output\libraries\substance-watermark-pack.jar;C:\dev\prgm_SerialTest\output\libraries\substance.jar;C:\dev\prgm_SerialTest\output\framework\framework.jar -Dlauncher.program=C:\dev\prgm_SerialTest\output\run.exe -Dborland.executable.path=C:\dev\prgm_SerialTest\output\run.exe exit
    java_command: <unknown>
    Launcher Type: generic
    Environment Variables:
    JAVA_HOME=C:\Program Files\Java\jdk1.5.0_07
    CLASSPATH=.;C:\Program Files\J-Integra\lib\jintegra.jar
    PATH=C:\Python24;C:\Cygwin\usr\local\bin;C:\Cygwin\bin;C:\Cygwin\bin;C:\emacs-21.3\bin;C:\Cygwin\usr\X11R6\bin;C:\Program Files\Java\jdk1.5.0_07\bin;C:\WINDOWS\system32;.
    USERNAME=pjflugst
    DISPLAY=:0.0
    OS=CYGWIN_NT-5.1
    PROCESSOR_IDENTIFIER=x86 Family 15 Model 2 Stepping 9, GenuineIntel
    --------------- S Y S T E M ---------------
    OS: Windows XP Build 2600 Service Pack 2
    CPU:total 1 family 15, cmov, cx8, fxsr, mmx, sse, sse2, ht
    Memory: 4k page, physical 1570800k(795748k free), swap 2207104k(1492344k free)
    vm_info: Java HotSpot(TM) Client VM (1.5.0_07-b03) for windows-x86, built on May 3 2006 01:04:38 by "java_re" with MS VC++ 6.0

  • Why cant I delete C++ pointer in JNI DLL

    Hi,
    I'm new to JNI and pretty rusty on C++, normally I stick to 100% Java, however I had a need for some native magic. My code works well and does the job I needed however my (old) knowledge of C++ tells me that I need to clean my objects up when I'm done. However I am unable to delete a pointer and I'm pretty sure its got something to do with JNI and lots to do with my lack of indepth knowledge. Here's what my code does.
    I have a Java app (J) that statically loads my DLL
    "J" calls a native c++ function within the DLL called (S).
    "S" creates a C++ object using the "new" operator, called (T).
    "T" is a Thread which I then start ( it runs for 1minute)
    "S" does not wait for "T" to finish, instead it returns immediately, passing the pointer to "T" back to "J"
    "J" then starts a normal Java Thread and every 10secs calls a native function from the DLL, called (C), and passes the pointer to "T".
    "C" then checks "T" to find out if it has finished, if not then it returns % complete as an "int". If "T" has finished it throws an Exception, and then attempts to delete "T" calling the following code :-
    delete T;
    T = 0;
    printf("\ndone\n");However it crashed on "delete T", if I comment both these lines out everything completes ok.
    My first thought was that "T" is already deleted, however I've checked and this is not the case, it still points to a valid "T" object. I know this because if I let my Java Thread continue to query for status long after "T" has stopped it still gets the last status message.
    So my problem is, how do I delete "T"?. The system crashes if I try......interestingly enough though if I comment out the "delete T" line and leave the "T=0" line then I get an "Access Violation" error instead.
    Does this mean that C++ does not own the object anymore (becase I passed it to Java). Does Java now own it and will it garbage collect it for me?
    Thanks for any help
    Chris.

    Hi,
    Not sure how I can pinpoint the stack corruption? Here's the JNI log produce when I use "ie=0", perhaps it would mean something to you.
    # An unexpected error has been detected by HotSpot Virtual Machine:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0afd2bb7, pid=3584, tid=1680
    # Java VM: Java HotSpot(TM) Client VM (1.5.0_03-b07 mixed mode)
    # Problematic frame:
    # C [IEConnectionJNI.dll+0x2bb7]
    --------------- T H R E A D ---------------
    Current thread (0x0acc3d28): JavaThread "Thread-0" [_thread_in_native, id=1680]
    siginfo: ExceptionCode=0xc0000005, reading address 0x00000010
    Registers:
    EAX=0x0b4cfca0, EBX=0x06c77528, ECX=0x00000000, EDX=0x0b149438
    ESP=0x0b4cfc34, EBP=0x0b4cfcb0, ESI=0x0b4cfc38, EDI=0x0b4cfcb0
    EIP=0x0afd2bb7, EFLAGS=0x00010246
    Top of Stack: (sp=0x0b4cfc34)
    0x0b4cfc34: 00001388 0acc3d28 06c77520 06c77528
    0x0b4cfc44: cccccccc cccccccc cccccccc cccccccc
    0x0b4cfc54: cccccccc cccccccc cccccccc cccccccc
    0x0b4cfc64: cccccccc cccccccc cccccccc cccccccc
    0x0b4cfc74: cccccccc cccccccc cccccccc cccccccc
    0x0b4cfc84: cccccccc 0b311910 cccccccc 0b311910
    0x0b4cfc94: 0b311910 cccccccc cccccccc 0b13d2d8
    0x0b4cfca4: cccccccc 00a86770 00000000 0b4cfce0
    Instructions: (pc=0x0afd2bb7)
    0x0afd2ba7: f0 e8 ca 5f 0c 00 8b f4 68 88 13 00 00 8b 4d fc
    0x0afd2bb7: 8b 51 10 52 ff 15 b8 d3 14 0b 3b f4 e8 b8 a0 00
    Stack: [0x0b490000,0x0b4d0000), sp=0x0b4cfc34, free space=255k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    C [IEConnectionJNI.dll+0x2bb7]
    j system.IEConnectionJNI.getDownloadStatus(I)Ljava/lang/String;+0
    j system.IEConnectionJNI$ProgressCheck.run()V+17
    v ~StubRoutines::call_stub
    V [jvm.dll+0x818b8]
    V [jvm.dll+0xd431d]
    V [jvm.dll+0x81789]
    V [jvm.dll+0x814e6]
    V [jvm.dll+0x9c06b]
    V [jvm.dll+0xfe7f5]
    V [jvm.dll+0xfe7c3]
    C [MSVCRT.dll+0x2a3b0]
    C [kernel32.dll+0xb683]
    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j system.IEConnectionJNI.getDownloadStatus(I)Ljava/lang/String;+0
    j system.IEConnectionJNI$ProgressCheck.run()V+17
    v ~StubRoutines::call_stub
    --------------- P R O C E S S ---------------
    Java Threads: ( => current thread )
    0x00037180 JavaThread "DestroyJavaVM" [_thread_blocked, id=3588]
    =>0x0acc3d28 JavaThread "Thread-0" [_thread_in_native, id=1680]
    0x00aca528 JavaThread "Monitor Ctrl-Break" daemon [_thread_in_native, id=3660]
    0x00a92730 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=2336]
    0x00a913a8 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3648]
    0x00a90730 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=3644]
    0x00a87c18 JavaThread "Finalizer" daemon [_thread_blocked, id=3640]
    0x00a86810 JavaThread "Reference Handler" daemon [_thread_blocked, id=2144]
    Other Threads:
    0x00a84ea8 VMThread [id=3624]
    0x00a93908 WatcherThread [id=3656]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    def new generation total 576K, used 378K [0x02ad0000, 0x02b70000, 0x02fb0000)
    eden space 512K, 74% used [0x02ad0000, 0x02b2eb90, 0x02b50000)
    from space 64K, 0% used [0x02b50000, 0x02b50000, 0x02b60000)
    to space 64K, 0% used [0x02b60000, 0x02b60000, 0x02b70000)
    tenured generation total 1408K, used 0K [0x02fb0000, 0x03110000, 0x06ad0000)
    the space 1408K, 0% used [0x02fb0000, 0x02fb0000, 0x02fb0200, 0x03110000)
    compacting perm gen total 8192K, used 1815K [0x06ad0000, 0x072d0000, 0x0aad0000)
    the space 8192K, 22% used [0x06ad0000, 0x06c95e60, 0x06c96000, 0x072d0000)
    No shared spaces configured.
    Dynamic libraries:
    0x00400000 - 0x0040c000      C:\jdk1.5.0_03\bin\java.exe
    0x7c900000 - 0x7c9b0000      C:\WINDOWS\system32\ntdll.dll
    0x7c800000 - 0x7c8f4000      C:\WINDOWS\system32\kernel32.dll
    0x77dd0000 - 0x77e6b000      C:\WINDOWS\system32\ADVAPI32.dll
    0x77e70000 - 0x77f01000      C:\WINDOWS\system32\RPCRT4.dll
    0x77c10000 - 0x77c68000      C:\WINDOWS\system32\MSVCRT.dll
    0x6d6b0000 - 0x6d836000      C:\jdk1.5.0_03\jre\bin\client\jvm.dll
    0x77d40000 - 0x77dd0000      C:\WINDOWS\system32\USER32.dll
    0x77f10000 - 0x77f57000      C:\WINDOWS\system32\GDI32.dll
    0x76b40000 - 0x76b6d000      C:\WINDOWS\system32\WINMM.dll
    0x76390000 - 0x763ad000      C:\WINDOWS\system32\IMM32.DLL
    0x6d2f0000 - 0x6d2f8000      C:\jdk1.5.0_03\jre\bin\hpi.dll
    0x76bf0000 - 0x76bfb000      C:\WINDOWS\system32\PSAPI.DLL
    0x6d680000 - 0x6d68c000      C:\jdk1.5.0_03\jre\bin\verify.dll
    0x6d370000 - 0x6d38d000      C:\jdk1.5.0_03\jre\bin\java.dll
    0x6d6a0000 - 0x6d6af000      C:\jdk1.5.0_03\jre\bin\zip.dll
    0x10000000 - 0x10007000      C:\Program Files\JetBrains\IntelliJ IDEA 6.0\bin\breakgen.dll
    0x0afd0000 - 0x0b15f000      C:\projects\relatis_systray\IEConnectionJNI.dll
    0x61410000 - 0x61534000      C:\WINDOWS\system32\urlmon.dll
    0x774e0000 - 0x7761d000      C:\WINDOWS\system32\ole32.dll
    0x77120000 - 0x771ac000      C:\WINDOWS\system32\OLEAUT32.dll
    0x77f60000 - 0x77fd6000      C:\WINDOWS\system32\SHLWAPI.dll
    0x5dca0000 - 0x5dce5000      C:\WINDOWS\system32\iertutil.dll
    0x5d090000 - 0x5d12a000      C:\WINDOWS\system32\COMCTL32.dll
    0x771b0000 - 0x7727e000      C:\WINDOWS\system32\WININET.dll
    0x003f0000 - 0x003f9000      C:\WINDOWS\system32\Normaliz.dll
    0x73000000 - 0x73026000      C:\WINDOWS\system32\WINSPOOL.DRV
    0x763b0000 - 0x763f9000      C:\WINDOWS\system32\comdlg32.dll
    0x7c9c0000 - 0x7d1d5000      C:\WINDOWS\system32\SHELL32.dll
    0x773d0000 - 0x774d3000      C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2982_x-ww_ac3f9c03\comctl32.dll
    0x6d530000 - 0x6d543000      C:\jdk1.5.0_03\jre\bin\net.dll
    0x71ab0000 - 0x71ac7000      C:\WINDOWS\system32\WS2_32.dll
    0x71aa0000 - 0x71aa8000      C:\WINDOWS\system32\WS2HELP.dll
    0x77fe0000 - 0x77ff1000      C:\WINDOWS\system32\Secur32.dll
    0x71a50000 - 0x71a8f000      C:\WINDOWS\system32\mswsock.dll
    0x662b0000 - 0x66308000      C:\WINDOWS\system32\hnetcfg.dll
    0x71a90000 - 0x71a98000      C:\WINDOWS\System32\wshtcpip.dll
    0x5ad70000 - 0x5ada8000      C:\WINDOWS\system32\uxtheme.dll
    0x10100000 - 0x1010e000      C:\Program Files\Logitech\SetPoint\lgscroll.dll
    0x7c340000 - 0x7c396000      C:\WINDOWS\system32\MSVCR71.dll
    0x7c3a0000 - 0x7c41b000      C:\WINDOWS\system32\MSVCP71.dll
    0x76ee0000 - 0x76f1c000      C:\WINDOWS\system32\RASAPI32.dll
    0x76e90000 - 0x76ea2000      C:\WINDOWS\system32\rasman.dll
    0x5b860000 - 0x5b8b4000      C:\WINDOWS\system32\NETAPI32.dll
    0x76eb0000 - 0x76edf000      C:\WINDOWS\system32\TAPI32.dll
    0x76e80000 - 0x76e8e000      C:\WINDOWS\system32\rtutils.dll
    0x769c0000 - 0x76a73000      C:\WINDOWS\system32\USERENV.dll
    0x722b0000 - 0x722b5000      C:\WINDOWS\system32\sensapi.dll
    0x76fc0000 - 0x76fc6000      C:\WINDOWS\system32\rasadhlp.dll
    0x76f20000 - 0x76f47000      C:\WINDOWS\system32\DNSAPI.dll
    0x76fb0000 - 0x76fb8000      C:\WINDOWS\System32\winrnr.dll
    0x76f60000 - 0x76f8c000      C:\WINDOWS\system32\WLDAP32.dll
    VM Arguments:
    jvm_args: -Didea.launcher.port=7534 -Didea.launcher.bin.path=C:\Program Files\JetBrains\IntelliJ IDEA 6.0\bin -Dfile.encoding=windows-1252
    java_command: com.intellij.rt.execution.application.AppMain system.IEConnectionJNI
    Environment Variables:
    CLASSPATH=.;C:\Program Files\Java\jre1.5.0_03\lib\ext\QTJava.zip
    PATH=C:\oracle\product\10.2.0\db_1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\SecureCRT\;C:\exim_downloaded\bin;C:\BES\bin;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual Studio\Common\Tools;C:\Program Files\Microsoft Visual Studio\VC98\bin;C:\BES\bin
    USERNAME=Chris
    OS=Windows_NT
    PROCESSOR_IDENTIFIER=x86 Family 15 Model 3 Stepping 4, GenuineIntel
    --------------- S Y S T E M ---------------
    OS: Windows XP Build 2600 Service Pack 2
    CPU:total 2 family 15, cmov, cx8, fxsr, mmx, sse, sse2, ht
    Memory: 4k page, physical 2096340k(1206824k free), swap 4194303k(3968120k free)
    vm_info: Java HotSpot(TM) Client VM (1.5.0_03-b07) for windows-x86, built on Apr 13 2005 02:07:01 by "java_re" with MS VC++ 6.0

  • JNI : DLL cannot be

    Hello,
    I am using a DLL through JNI.
    Up to now, my program works perfectly on all computers and systems.
    But, I encountered an error on one computer as if it couldn't find the dll (whereas it is well located):
    java.lang.UnsatisfiedLinkError: D:\Projects\Java\Tool\Native.dll: Can't find dependent libraries
         at java.lang.ClassLoader$NativeLibrary.load(Native Method)Can someone help me, please ?
    Note:
    If I removed that dll on a system that works normally, I encountered that error:
    java.lang.UnsatisfiedLinkError: no Native in java.library.path
         at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1491)

    Greetings, Catharsis. I have a quite similar situation.
    I am working on a project which uses a comercial API (Netica, from Norsis) through a dll (dll A). dll A interacts, through JNI, with another dll (dll B). I checked this dependency with a program to inspect DLL features (dependencies, for example).
    What happens is that an error-window pops out saying that it cannot find dll B on which the one I load (dll A), depends on.
    I don't use static blocks with System.loadLibrary, since this is done by a runtime variable I use, upon its initialization.
    I assigned the user path variable's value for these dlls' directory to the system path's variable and still I get the error.
    I used a file access monitor to find out that dll A tries to load dll B on a directory one level above the original (and correct) one.
    What's strange:
    1- It only happens in one recently configured Windows PC. Path variables and instalation directories are equal between PC where it works and the other where it doesn't.
    2- I also tried to build JNI code for another project in the PC which prompts the error, and it yelds errors in jni.h from jdk 1.5. (so I have this feeling that something's wrong with this PCs JNI)
    Note:
    1- jdk was reinstalled;
    2- the comercial API, whose installation sums up to extraction to install dir and path variable tuning, was reinstalled; and,
    2- Eclipse's project settings are equal between the two PCs, since one project is a full copy of the other.
    Any ideas?
    Best regards.

Maybe you are looking for

  • Problems with Windows 8.1 and Acrobat Reader XI

    I have two problems which are likely related.  First I can no longer save .PDF files that already include saved comments, and secondaly, I can no longer delete .PDF files.  Any suggestions?

  • Licenses of iwork 09

    Hi, I am planning to do a complete re-installation of Mac OS X (erase all data and start from scratch). I am presently using iwork 09, do I have to revoke the license of iworks before I re-install the OS X. Note - I bought iworks 09 from the apple st

  • File upload diff server

    hi i have done the file upload using java program with in same network.but when i try to upload to a file server of other domain then the upload is not working.i can ping to the file server but through java application the file does n't get uploaded.

  • Oracle workflow server with linux

    In "10g Release 1 (10.1.0.4) Patch Set 2 for Linux x86 Patch Set Notes", it is mentioned that modplsql is not currently supported on Red Hat Enterprise Linux 4. For this reason, HTML DB and Oracle Workflow are not currently supported on Red Hat Enter

  • Setting up a WPA2 network connection

    Hello, I am trying to set up a iBook G4 on my company Wi-Fi network. We are using WPA2 for are security type, and Leap for authentication. When trying to create a new connection I put the SSID in the Network Name. I select WPA2 Enterprise for my secu