AV when using JNI

Hi,
We have faced a problem that is very similar to the one reported in this thread:
http://forums.bea.com/bea/message.jspa?messageID=200010160&tstart=0
Has the problem been fixed in a later release?
We are using BEA JRockit 5.0 R26.4.0-63 under Windows XP Professional 32-bit SP2 and still get Access Violations when using java.lang.Class.getDeclaredMethods() or java.lang.Class.getDeclaredFields(). The exception does not occur when we use the same module with Sun JVM and MS JVM.
If the problem is supposed to be fixed, I can provide more details.
Best regards,
Alex
~~~~~~~~~~~~~~~~~~~~~

Hello Staffan,
Thanks for your reply. Here is a description of the first problem we have faced:
When using JNI to call the java.lang.Class.getDeclaredMethods() or java.lang.Class.getDeclaredFields() method, we get the java.lang.NullPointerException exception in some cases. If we debug the java.exe process in Visual Studio 2005, we can see that the following exception occurs:
First-chance exception at 0x7d612b73 in java.exe: 0xC0000005: Access violation reading location 0x00000010.
Here is a part of the exception call stack:
7d612b73()
jvm.dll!_stubsCallC2JavaStub() + 0x24 bytes
jvm.dll!_callC2Java() + 0x309 bytes
jvm.dll!_jniCheckExceptionsForCall() + 0x12e bytes
jvm.dll!_jniCallObjectMethodA@16() + 0x3b bytes
jvm.dll!_jniGetVersion@4() + 0x993 bytes
tcJavaHook.dll!JNIEnv_::CallObjectMethodA(_jobject * obj=0x34960204, _jmethodID * methodID=0x77b84b08, const jvalue * args=0x00000000)  Line 879 + 0x1f bytes C++
We have done some investigations and found out that the problem occurs for the following classes:
java.lang.Class, javax.swing.JPanel, javax.swing.JLayeredPane, javax.swing.JToolBar, javax.swing.AbstractButton, javax.swing.JLabel,
javax.swing.JScrollPane, javax.swing.JViewport, javax.swing.JTable, javax.swing.CellRendererPane, javax.swing.JScrollBar, javax.swing.table.JTableHeader, javax.swing.JMenuBar, javax.swing.JComboBox, javax.swing.JSpinner, javax.swing.text.JTextComponent
While the exception does not occur when calling methods of the following classes:
javax.swing.JFrame, java.awt.Frame, javax.swing.JComponent, javax.swing.JRootPane, java.lang.Object, java.awt.Component, java.awt.Container, java.awt.Window, java.awt.Dialog, javax.swing.JDialog
We were able to reproduce the problem with Eclipse 3.1.2 launched in the following way:
I:\Java\jrockit-R26.4.0-jdk1.5.0_06\jre\bin\java.exe -Xms40m -Xmx256m -jar D:\Eclipse\startup.jar -os win32 -ws win32 -arch x86 -launcher D:\Eclipse\eclipse.exe -name Eclipse -showsplash 600 -exitdata 14a8_60 -vm I:\Java\jrockit-R26.4.0-jdk1.5.0_06\jre\bin\java.exe -vmargs -Xms40m -Xmx256m -jar D:\Eclipse\startup.jar
I:\Java\jrockit-R26.4.0-jdk1.5.0_06\ - the installation folder of JRockit JDK
D:\Eclipse\ - the root folder of Eclipse
In this case, even trying to get information about the java.lang.Object class fields and methods causes the problem.
Can you say anything based on the above call stack?
Please let me know if you need any details about the problem.
Best regards,
Alex
~~~~~~~~~~~~~~~~~~~~~

Similar Messages

  • Application crashes when using JNI with Jdk 1,2, 1.3 and 1.4

    Hi!
    I have this application that has a GUI written in Java and a file parser written in C. JNI is used to connect these parts together. The problem is that the application only works when I am using jdk 1.1.8 but not when using jdk1.2, jdk1.3 or jdk1.4. I am running the application on a Solaris 8 machine.
    I have not written the application myself but I am going to be working with it from now on. But I have today little knowledge with JNI and I have tried different approaches to solve the problem. For example I have tried to used DDD together with GDB to find out what the problem is but with no luck. When I run the application using jdk1.4 I get the following error when the JVM crashes:
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : 10 occurred at PC=0xFA023164
    Function=Java_Bitmap_setDebug+0x1C
    Library=/usr/u/lal/micview/micview2_1_0_beta1/libBitmapImpl.so
    Current Java thread:
    at Bitmap.setDebug(Native Method)
    at DisplayPanel.loadFile(DisplayPanel.java:396)
    at MicPlot.loadFile(MicPlot.java:1452)
    at MicPlot.loadFile(MicPlot.java:1441)
    at MicPlot.miOpen_Action(MicPlot.java:1267)
    at MicPlot$SymAction.actionPerformed(MicPlot.java:1184)
    at java.awt.MenuItem.processActionEvent(MenuItem.java:588)
    at java.awt.MenuItem.processEvent(MenuItem.java:548)
    at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:285)
    at java.awt.MenuComponent.dispatchEvent(MenuComponent.java:273)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:452)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
    Dynamic libraries:
    0x10000 /opt/java/jdk1.4/bin/java
    0xff360000 /usr/lib/libthread.so.1
    0xff3a0000 /usr/lib/libdl.so.1
    0xff280000 /usr/lib/libc.so.1
    0xff270000 /usr/platform/SUNW,Ultra-4/lib/libc_psr.so.1
    0xfe000000 /opt/java/j2sdk1.4.1/jre/lib/sparc/client/libjvm.so
    0xff220000 /usr/lib/libCrun.so.1
    0xff200000 /usr/lib/libsocket.so.1
    0xff100000 /usr/lib/libnsl.so.1
    0xff1d0000 /usr/lib/libm.so.1
    0xff250000 /usr/lib/libw.so.1
    0xff0e0000 /usr/lib/libmp.so.2
    0xff0b0000 /opt/java/j2sdk1.4.1/jre/lib/sparc/native_threads/libhpi.so
    0xff080000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libverify.so
    0xff030000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libjava.so
    0xfe7e0000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libzip.so
    0xfe4e0000 /usr/lib/locale/en_US.ISO8859-1/en_US.ISO8859-1.so.2
    0xedd00000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libawt.so
    0xfc480000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libmlib_image.so
    0xfc410000 /opt/java/j2sdk1.4.1/jre/lib/sparc/motif21/libmawt.so
    0xeda80000 /usr/dt/lib/libXm.so.4
    0xfa090000 /usr/openwin/lib/libXt.so.4
    0xfa3d0000 /usr/openwin/lib/libXext.so.0
    0xfc7e0000 /usr/openwin/lib/libXtst.so.1
    0xed980000 /usr/openwin/lib/libX11.so.4
    0xfa2a0000 /usr/openwin/lib/libdps.so.5
    0xfa3b0000 /usr/openwin/lib/libSM.so.6
    0xfa1d0000 /usr/openwin/lib/libICE.so.6
    0xed880000 /opt/java/j2sdk1.4.1/jre/lib/sparc/libfontmanager.so
    0xfa390000 /usr/openwin/lib/locale/common/xlibi18n.so.2
    0xfa1b0000 /usr/openwin/lib/locale/iso8859-1/xomEuro.so.2
    0xfa190000 /usr/lib//liblayout.so
    0xfa050000 /usr/openwin/lib/locale/common/ximlocal.so.2
    0xfa010000 /usr/u/lal/micview/micview2_1_0_beta1/libBitmapImpl.so
    Local Time = Thu Oct 3 13:32:47 2002
    Elapsed Time = 35
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) Client VM (1.4.1-beta-b14 mixed mode)
    # An error report file has been saved as hs_err_pid27692.log.
    # Please refer to the file for further information.
    Abort
    From this information I think that the problem should be in the native method setDebug. But I have tried to set a breakpoint at the beginning of that function in the C part but with no luck. The application crashes before it reaches that position in the C file.
    What could possibly go wrong between the setDebug function in the C part and the function call in the Java part?
    When using GDB, GDB cannot figure out what is wrong it just returns a hex address, no function name.
    I would really appreciate some help. I have tried everything that I can come up with!
    Best regards
    Lars

    I have figured out that the application fails on its first call to the native methods.
    So I have this Bitmap class that contains all the native calls and it is defined shortly as follow:
    public class Bitmap {
    static {
    System.loadLibrary("BitmapImpl");
    native void setDebug(int debuglevel, int statistics);
    There are many more native methods defined in Bitmap, but I only show the setDebug method because that is the first one that is executed and also the one that immediately fails.
    My setDebug C function is defined as follow in BitmapImpl.c
    #include <time.h>
    #include <stdio.h>
    #include <limits.h>
    #include <fcntl.h>
    #include <jni.h>
    #include <math.h>
    #include <errno.h>
    #include "Bitmap.h"
    #include "data.h"
    jint debug = 0;
    jint statistics = 1;
    JNIEXPORT void JNICALL Java_Bitmap_setDebug
    (JNIEnv *jenv, jobject jo, jint d, jint s)
    debug = d;
    statistics = s;
    My libBitmapImpl.so file is compiled using the following Makefile and using GNU gcc:
    JAVAPATH=$(JAVAINCLUDEPATH)
    LMACRO=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DSOLARIS
    CSOURCE=BitmapImpl.c
    all:
    gcc -O3 -G $(LMACRO) -I$(JAVAPATH) -I$(JAVAPATH)/solaris \
    $(CSOURCE) -o libBitmapImpl.so
    It is still a total mystory why the application fails. I have tried it on a RedHat Linux machine and there it works fine. But not on Solaris. Only if I use the jdk1.1.8 but not a later one.
    Would really appreiciate some help!
    Best regards
    Lars

  • App crash when using JNI callbacks

    Hi all,
    I have a solaris application which crashes when I try to callback the JNI methods from the native code. The description of the problem is below
    Written a native library, the library is multithreaded (i.e) I create a thread using pthread_create() in the native code which performs the operation of calling a JAVA method from the native code. The routine of calling the JAVA method works perfectly from elsewhere.
    There are two scenarios I've tested it in
    1. I created a thread (say X) from the main thread (say Y) and made the y to wait until the X is complete using the pthread_join(). The JAVA callbacks work fine when called from Y but the app crashes if done from X.
    2. Did not make the Y to wait until the X is complete, hoping that both will run paralelly and even the the App crashes.
    And to be precise the Y is the thread where the native method is called from JAVA.
    I have tested for any memory leaks or stack corruption by removing the JAVA callbacks and bulding a executable and using purify, the report doesnot hint any such occurances.
    The linker options used for building the shared library is as follows
    ${GPP} ${INC} -G ${LIB} -mt -g -lCstd -lCrun -lpthread ${OBJS} -o <lib-name>
    I wonder if we can create threads in the native code when using JAVA callbacks and even if we can whether it would be appropiate to use the callbacks with in the threads
    Looking forward for any help.
    Regards,
    Vamsi

    Guys... can't any one help me with this problem :(

  • JVM Crash When Using JNI and COM

    I'm trying to call a DLL compiled from VB6 source code that I do not have access to. The VB6 code simply retrieves data from a DB2 database using ADO and my client code grabs that data and marshals it to my Java code. I'm attempting to achieve this using JNI and COM (without a third-party bridge). It works 75% of the time, but the other 25% of the time, the JVM crashes with the usual Hotspot crash log containing an access violation exception. However, I don't know what in my C++ code (VC++ 8) could be causing this except for passing a "wild" pointer to the code lying underneath the COM object interface. If that is the case, I don't know how I am doing that.
    The Java code that is calling my native method is running on Tomcat 5.5.25 and just to be safe, I am not allowing multiple threads to concurrently call the method in my JNI DLL (though I realize that this will kill performance). Once I can get past this problem, I'll do the COM interfacing on a worker thread in my native code so I don't screw up CoInitialize and CoUninitialize calls in the case the same thread is concurrently executing multiple calls to my native code.
    I've noticed that in most cases, the JVM crashes during my call to the pClsAccount->OpenConnection method. However, my DLL isn't what is listed on the top of the call stack, which is why I suspect the passing of a wild pointer, though I'm just taking a guess at that. Does anyone have an idea as to what's going on ?
    JNIEXPORT jobject JNICALL Java_CustomerInfo_nGetCustomerAccountInfo(JNIEnv *env, jobject customerInfo, jstring accountNumber, jstring iniFileName)
    jboolean isCopy;
    // Account info class and instance to be instantiated
    jclass accountInfoCls = NULL;
    jobject accountInfoObj = NULL;
    // The constructor ID of the accountInfoCls
    jmethodID ctorID = NULL;
    // Pointer to the interface for the ClsAccount COM object
    _clsAccount *pClsAccount = NULL;
    HRESULT hr;
    BSTR bstrIniFileName(L"");
    try
    const char *nativeAccountNumber = NULL;
    if (accountNumber != NULL)
    nativeAccountNumber = env->GetStringUTFChars(accountNumber, &isCopy);
    else
    jclass newExcCls;
    env->ExceptionDescribe();
    env->ExceptionClear();
    newExcCls = env->FindClass("java/lang/IllegalArgumentException");
    env->ThrowNew(newExcCls, "accountNumber passed in was null !");
    return NULL;
    // Initialization
    variantt varConnectionSucceeded = variantt(false);
    variantt varGetAccountInfoSucceeded = variantt(false);
    variantt varAccountNumber = variantt(nativeAccountNumber);
    bstrt bstrLastPaymentDate = bstrt();
    bstrt bstrLastErrorMessage = bstrt();
    bstrt bstrLastErrorNumber = bstrt();
    jlong jTotalDue = NULL;
    jlong jEstablishedDueDay = NULL;
    jlong jLastPaymentAmount = NULL;
    jstring jLastPaymentDate = NULL;
    jstring jLastErrorMessage = NULL;
    jstring jLastErrorNumber = NULL;
    jthrowable jException = NULL;
    const char *chLastPaymentDate = NULL;
    const char *chLastErrorMessage = NULL;
    const char *chLastErrorNumber = NULL;
    long long totalDue;
    long long lastPaymentAmount;
    long establishedDueDateDay;
    //Convert string from Java string to C string to VB string
    const char *nativeIniFileName = NULL;
    if (iniFileName != NULL)
    nativeIniFileName = env->GetStringUTFChars(iniFileName, &isCopy);
    else
    jclass newExcCls;
    env->ExceptionDescribe();
    env->ExceptionClear();
    newExcCls = env->FindClass("java/lang/IllegalArgumentException");
    env->ThrowNew(newExcCls, "iniFileName passed in was null");
    return NULL;
    bstrIniFileName = comutil::ConvertStringToBSTR(nativeIniFileName);
    CoInitialize(NULL);
    // Create an instance of the COClass with the interface over it
    hr = CoCreateInstance(__uuidof(clsAccount), NULL, CLSCTX_INPROC_SERVER, __uuidof(_clsAccount), (void **)&pClsAccount);
    if (hr == S_OK)
    varConnectionSucceeded.boolVal = pClsAccount->OpenConnection(&bstrIniFileName);
    &#12288;
    if (varConnectionSucceeded.boolVal == -1)
    varGetAccountInfoSucceeded.boolVal = pClsAccount->GetAccountPaymentInformation(&(varAccountNumber.GetVARIANT()));
    env->ReleaseStringUTFChars(accountNumber, nativeAccountNumber);
    // Extract all available account information from the ClsAccount object
    if (varGetAccountInfoSucceeded.boolVal == -1)
    totalDue = pClsAccount->TotalDue.int64;
    establishedDueDateDay = pClsAccount->EstablishedDueDateDay;
    lastPaymentAmount = pClsAccount->LastPaymentAmount.int64;
    bstrLastPaymentDate = pClsAccount->LastPaymentDate;
    chLastPaymentDate = comutil::ConvertBSTRToString(bstrLastPaymentDate.GetBSTR());
    jTotalDue = (jlong)totalDue;
    jEstablishedDueDay = (jlong)establishedDueDateDay;
    jLastPaymentAmount = (jlong)lastPaymentAmount;
    jLastPaymentDate = env->NewStringUTF(chLastPaymentDate);
    delete[] chLastPaymentDate;
    pClsAccount->CloseConnection();
    // Populate error fields if any errors occur
    bstrLastErrorMessage = pClsAccount->LastErrMessage;
    chLastErrorMessage = comutil::ConvertBSTRToString(bstrLastErrorMessage.GetBSTR());
    bstrLastErrorNumber = pClsAccount->LastErrNumber;
    chLastErrorNumber = comutil::ConvertBSTRToString(bstrLastErrorNumber.GetBSTR());
    jLastErrorMessage = env->NewStringUTF(chLastErrorMessage);
    jLastErrorNumber = env->NewStringUTF(chLastErrorNumber);
    delete[] chLastErrorMessage;
    delete[] chLastErrorNumber;
    const char* clsName = "com/nuance/merchantsmutual/businessentities/CustomerAccountInfo";
    // Find the Java class and the ID of its constructor
    accountInfoCls = env->FindClass(clsName);
    ctorID = env->GetMethodID(accountInfoCls, "<init>", "(JJJLjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
    jException = env->ExceptionOccurred();
    if (jException != NULL)
    env->ExceptionDescribe();
    env->ExceptionClear();
    //Release all resources associated with the ClsAccount instance
    pClsAccount->Release();
    //Instantiate the class with the given parameters
    accountInfoObj = env->NewObject(accountInfoCls, ctorID, jTotalDue, jEstablishedDueDay, jLastPaymentAmount, jLastPaymentDate, jLastErrorMessage, jLastErrorNumber);
    jException = env->ExceptionOccurred();
    if (jException != NULL)
    env->ExceptionDescribe();
    env->ExceptionClear();
    else if (hr == REGDB_E_CLASSNOTREG)
    cout << "COM class not registered" << endl;
    else if ( hr == CLASS_E_NOAGGREGATION)
    cout << "COM class can't be aggregated" << endl;
    else if (hr == E_NOINTERFACE)
    cout << "No interface for COM class clsAccount" << endl;
    else if (hr == E_POINTER)
    cout << "*ppv pointer was NULL !" << endl;
    else
    cout << "Error occurred while creating COM object. HR is [" << hr << "]" << endl;
    // Free the BSTR because a new one was returned with a call to comutil::ConvertStringToBSTR
    SysFreeString(bstrIniFileName);
    // Release the string when it's no longer needed. MUST call if string won't be used
    // anymore or else a memory leak will occur
    env->ReleaseStringUTFChars(iniFileName, nativeIniFileName);
    CoUninitialize();
    &#12288;
    catch (_com_error &e)
    cout << "Encountered an exception in GetCustomerAccountInfo: Error was " << e.ErrorMessage();
    pClsAccount->Release();
    catch (...)
    pClsAccount->Release();
    return accountInfoObj;
    Edited by: Cthulhu76 on Jan 5, 2010 9:18 AM

    0x49202400 JavaThread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" daemon [_thread_blocked, id=5340, stack(0x49bf0000,0x49c40000)]
    0x48a7e800 JavaThread "Thread-1" [_thread_in_native, id=5976, stack(0x48f00000,0x48f50000)]
    0x48a0dc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3072, stack(0x48c60000,0x48cb0000)]
    0x48a09000 JavaThread "CompilerThread0" daemon [_thread_blocked, id=4988, stack(0x48c10000,0x48c60000)]
    0x48a07c00 JavaThread "Attach Listener" daemon [_thread_blocked, id=3124, stack(0x48bc0000,0x48c10000)]
    0x48a07000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2572, stack(0x48b70000,0x48bc0000)]
    0x489f5c00 JavaThread "Finalizer" daemon [_thread_blocked, id=5752, stack(0x48b20000,0x48b70000)]
    0x489f4c00 JavaThread "Reference Handler" daemon [_thread_blocked, id=2596, stack(0x48ad0000,0x48b20000)]
    0x003c6000 JavaThread "main" [_thread_in_native, id=4252, stack(0x00820000,0x00870000)]
    Other Threads:
    0x489f0400 VMThread [stack: 0x48a80000,0x48ad0000] [id=5624]
    0x48a18800 WatcherThread [stack: 0x48cb0000,0x48d00000] [id=1192]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    def new generation total 36288K, used 12762K [0x02940000, 0x050a0000, 0x07800000)
    eden space 32256K, 34% used [0x02940000, 0x0343af58, 0x048c0000)
    from space 4032K, 37% used [0x04cb0000, 0x04e2ba28, 0x050a0000)
    to space 4032K, 0% used [0x048c0000, 0x048c0000, 0x04cb0000)
    tenured generation total 483968K, used 7518K [0x07800000, 0x250a0000, 0x42940000)
    the space 483968K, 1% used [0x07800000, 0x07f57958, 0x07f57a00, 0x250a0000)
    compacting perm gen total 14080K, used 14016K [0x42940000, 0x43700000, 0x46940000)
    the space 14080K, 99% used [0x42940000, 0x436f0320, 0x436f0400, 0x43700000)
    No shared spaces configured.
    Dynamic libraries:
    0x00400000 - 0x0040f000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\bin\tomcat5.exe
    0x7c800000 - 0x7c8c0000      C:\WINDOWS\system32\ntdll.dll
    0x77e40000 - 0x77f42000      C:\WINDOWS\system32\kernel32.dll
    0x77380000 - 0x77411000      C:\WINDOWS\system32\USER32.dll
    0x77c00000 - 0x77c48000      C:\WINDOWS\system32\GDI32.dll
    0x77f50000 - 0x77feb000      C:\WINDOWS\system32\ADVAPI32.dll
    0x77c50000 - 0x77cef000      C:\WINDOWS\system32\RPCRT4.dll
    0x76f50000 - 0x76f63000      C:\WINDOWS\system32\Secur32.dll
    0x77ba0000 - 0x77bfa000      C:\WINDOWS\system32\MSVCRT.dll
    0x7c8d0000 - 0x7d0cf000      C:\WINDOWS\system32\SHELL32.dll
    0x77da0000 - 0x77df2000      C:\WINDOWS\system32\SHLWAPI.dll
    0x76290000 - 0x762ad000      C:\WINDOWS\system32\IMM32.DLL
    0x77420000 - 0x77523000      C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.3790.3959_x-ww_D8713E55\comctl32.dll
    0x6d7c0000 - 0x6da10000      C:\Program Files\Java\jre1.6.0_07\bin\client\jvm.dll
    0x76aa0000 - 0x76acd000      C:\WINDOWS\system32\WINMM.dll
    0x7c340000 - 0x7c396000      C:\WINDOWS\system32\MSVCR71.dll
    0x6d270000 - 0x6d278000      C:\Program Files\Java\jre1.6.0_07\bin\hpi.dll
    0x76b70000 - 0x76b7b000      C:\WINDOWS\system32\PSAPI.DLL
    0x6d770000 - 0x6d77c000      C:\Program Files\Java\jre1.6.0_07\bin\verify.dll
    0x6d310000 - 0x6d32f000      C:\Program Files\Java\jre1.6.0_07\bin\java.dll
    0x6d7b0000 - 0x6d7bf000      C:\Program Files\Java\jre1.6.0_07\bin\zip.dll
    0x6d570000 - 0x6d583000      C:\Program Files\Java\jre1.6.0_07\bin\net.dll
    0x71c00000 - 0x71c17000      C:\WINDOWS\system32\WS2_32.dll
    0x71bf0000 - 0x71bf8000      C:\WINDOWS\system32\WS2HELP.dll
    0x71b20000 - 0x71b61000      C:\WINDOWS\system32\mswsock.dll
    0x5f270000 - 0x5f2ca000      C:\WINDOWS\system32\hnetcfg.dll
    0x71ae0000 - 0x71ae8000      C:\WINDOWS\System32\wshtcpip.dll
    0x76ed0000 - 0x76efa000      C:\WINDOWS\system32\DNSAPI.dll
    0x76f70000 - 0x76f77000      C:\WINDOWS\System32\winrnr.dll
    0x76f10000 - 0x76f3e000      C:\WINDOWS\system32\WLDAP32.dll
    0x76f80000 - 0x76f85000      C:\WINDOWS\system32\rasadhlp.dll
    0x4a6a0000 - 0x4a6ac000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib\CustomerInfoProxy.dll
    0x77670000 - 0x777a9000      C:\WINDOWS\system32\ole32.dll
    0x77d00000 - 0x77d8b000      C:\WINDOWS\system32\OLEAUT32.dll
    0x7c420000 - 0x7c4a7000      C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_E6967989\MSVCP80.dll
    0x78130000 - 0x781cb000      C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_E6967989\MSVCR80.dll
    0x777b0000 - 0x77833000      C:\WINDOWS\system32\CLBCatQ.DLL
    0x77010000 - 0x770d6000      C:\WINDOWS\system32\COMRes.dll
    0x77b90000 - 0x77b98000      C:\WINDOWS\system32\VERSION.dll
    0x75da0000 - 0x75e5d000      C:\WINDOWS\system32\SXS.DLL
    0x75e60000 - 0x75e87000      C:\WINDOWS\system32\apphelp.dll
    0x4dc30000 - 0x4dc5e000      C:\WINDOWS\system32\msctfime.ime
    0x4b0d0000 - 0x4b395000      C:\WINDOWS\system32\xpsp2res.dll
    0x71bb0000 - 0x71bb9000      C:\WINDOWS\system32\WSOCK32.dll
    0x4bbe0000 - 0x4bbea000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib\ClearTranProxy.dll
    0x745e0000 - 0x7489e000      C:\WINDOWS\system32\msi.dll
    0x71c40000 - 0x71c97000      C:\WINDOWS\system32\NETAPI32.dll
    0x4bc50000 - 0x4bc6c000      C:\WINDOWS\system32\DBNETLIB.DLL
    0x71f60000 - 0x71f64000      C:\WINDOWS\system32\security.dll
    0x76c90000 - 0x76cb7000      C:\WINDOWS\system32\msv1_0.dll
    0x76cf0000 - 0x76d0a000      C:\WINDOWS\system32\iphlpapi.dll
    0x761b0000 - 0x76243000      C:\WINDOWS\system32\crypt32.dll
    0x76190000 - 0x761a2000      C:\WINDOWS\system32\MSASN1.dll
    0x4bcf0000 - 0x4bcff000      C:\Program Files\Common Files\System\Ole DB\SQLOLEDB.RLL
    0x4a8a0000 - 0x4a8aa000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib\MIGI.DLL
    0x73570000 - 0x736c2000      C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib\MSVBVM60.DLL
    0x4a950000 - 0x4a9e2000      C:\Program Files\Common Files\System\ado\msado15.dll
    0x74a50000 - 0x74a6a000      C:\WINDOWS\system32\MSDART.DLL
    0x4c850000 - 0x4c8c9000      C:\Program Files\Common Files\System\Ole DB\oledb32.dll
    0x4dbb0000 - 0x4dbc1000      C:\Program Files\Common Files\System\Ole DB\OLEDB32R.DLL
    VM Arguments:
    jvm_args: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 5.5 -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 5.5 -Djava.endorsed.dirs=C:\Program Files\Apache Software Foundation\Tomcat 5.5\common\endorsed -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 5.5\temp -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\logging.properties -Djava.library.path=C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\MMI\WEB-INF\lib vfprintf -Xms512m -Xmx1024m
    java_command: <unknown>
    Launcher Type: generic
    Environment Variables:
    JAVA_HOME=C:\Program Files\Java\jdk1.6.0_07
    [error occurred during error reporting (printing environment variables), id 0xc0000005]
    --------------- S Y S T E M ---------------
    OS: Windows Server 2003 family Build 3790 Service Pack 2
    CPU:total 4 (4 cores per cpu, 1 threads per core) family 6 model 7 stepping 6, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3
    Memory: 4k page, physical 2097151k(2097151k free), swap 4194303k(4194303k free)
    vm_info: Java HotSpot(TM) Client VM (10.0-b23) for windows-x86 JRE (1.6.0_07-b06), built on Jun 10 2008 01:14:11 by "java_re" with MS VC++ 7.1
    time: Mon Dec 28 15:24:00 2009
    elapsed time: 600 seconds

  • I have problem when use 'JNI'

    Hello every body,
    I have an application language "C", which, I must make a wrapper java.
    To do this using "JNI".
    First I try to understand the functioning of JNI, I try it for the first example helloWorld.
    all steps works well, and dynamic library was well create: libHelloWorld.so
    The execution, it does'nt work
    When I try to java Helloworld, here's what I see:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/java/jniexamples/HelloWorld/libHelloWorld.so: Can't load IA 32-bit .so on a IA 32-bit platform
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
    at java.lang.Runtime.loadLibrary0(Runtime.java:822)
    at java.lang.System.loadLibrary(System.java:993)
    at HelloWorld.<clinit>(HelloWorld.java:7)
    Although I added the link to my library like this:
    export LD_LIBRARY_PATH = $ LD_LIBRARY_PATH: / home / Install / java / jniexamples / HelloWorld
    I dont understand where is the problem may be in the version I use of java, I use jdk-1.5.0-13?
    Thank you in advance for your help
    Regards
    Daniel

    Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/java/jniexamples/HelloWorld/libHelloWorld.so: Can't load IA 32-bit .so As a guess that would suggest that it found a file (thus the name is correct) but that the contents do not represent a shared library that the VM will load.
    That is usually because the compile/link options are wrong for the target VM.

  • Segmentation fault when using jni application

    Hi I have a segmentation fault whe i use jni with a c++ program, i don't know how to read hs_err_pid....log, can someone help me to analyse this file
    # An unexpected error has been detected by HotSpot Virtual Machine:
    # SIGSEGV (0xb) at pc=0x9704e824, pid=15092, tid=2983283632
    # Java VM: Java HotSpot(TM) Client VM (1.5.0_15-b04 mixed mode, sharing)
    # Problematic frame:
    # C 0x9704e824
    --------------- T H R E A D ---------------
    Current thread (0x08379000): JavaThread "Xxxxxxxx main loop #1 (machine)" [_thread_in_native, id=15101]
    siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0x9704e824
    Registers:
    EAX=0xb1f9c030, EBX=0xb1edafa0, ECX=0x48411fc8, EDX=0x08377218
    ESP=0xb1d13bfc, EBP=0xb1d13c18, ESI=0xb1f1020a, EDI=0xb1edc5a8
    EIP=0x9704e824, CR2=0x9704e824, EFLAGS=0x00010286
    Top of Stack: (sp=0xb1d13bfc)
    0xb1d13bfc: b1e78eb5 b1f9c030 48411fc8 b1e78e2b
    0xb1d13c0c: b1f9b494 b1d13c50 b0786e50 b1d13c78
    0xb1d13c1c: b1f6a332 b0786e50 48411fc8 b1d13c48
    0xb1d13c2c: b7bca34c 083790c0 b1d13c40 08410e58
    0xb1d13c3c: 00a0b574 b1f9c030 0838b2e0 b074ed18
    0xb1d13c4c: b1fca214 b1f9c360 0838b2e0 b072e2d8
    0xb1d13c5c: b1fb761c 08373ce8 b1d13c94 b1f6a16f
    0xb1d13c6c: b1f9b494 08373c08 00000001 b1d13cc8
    Instructions: (pc=0x9704e824)
    0x9704e814:
    [error occurred during error reporting, step 100, id 0xb]
    Stack: [0xb1c94000,0xb1d15000), sp=0xb1d13bfc, free space=510k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    C 0x9704e824
    C [libxxxxxxxxxx.so.1.6+0x7d332] _ZN10MyApplication12Route4tickEj+0x1ce
    C [libxxxxxxxxxx.so.1.6+0x34248] _ZN10MyApplication4Core8workEj+0x34
    C [libyyyyyy.so+0x15457] ZN5CCore8mainLoopEP7JNIEnv+0x17f
    C [libyyyyyy.so+0x1f299] Java_com_xx_xxxxxxxx_xxxxxxxximpl_jni_JCore_run+0x35
    j com.xx.xxxxxxxx.xxxxxxxximpl.jni.JCore.run()V+0
    v ~StubRoutines::call_stub
    V [libjvm.so+0x17b2bc]
    V [libjvm.so+0x28fed8]
    V [libjvm.so+0x17ab15]
    V [libjvm.so+0x17abae]
    V [libjvm.so+0x1f2b15]
    V [libjvm.so+0x2f9933]
    V [libjvm.so+0x290ae8]
    C [libpthread.so.0+0x5371]
    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j com.xx.xxxxxxxx.xxxxxxxximpl.jni.JCore.run()V+0
    v ~StubRoutines::call_stub
    --------------- P R O C E S S ---------------
    Java Threads: ( => current thread )
    =>0x08379000 JavaThread "Xxxxxxxx main loop #1 (machine)" [_thread_in_native, id=15101]
    0x083634d8 JavaThread "Thread-0" [_thread_in_native, id=15100]
    0x080a5c60 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=15098]
    0x080a47a8 JavaThread "CompilerThread0" daemon [_thread_blocked, id=15097]
    0x080a3850 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=15096]
    0x0809dbe8 JavaThread "Finalizer" daemon [_thread_blocked, id=15095]
    0x0809bdb8 JavaThread "Reference Handler" daemon [_thread_blocked, id=15094]
    0x0805caa0 JavaThread "main" [_thread_in_native, id=15092]
    Other Threads:
    0x0809a940 VMThread [id=15093]
    0x080a71d0 WatcherThread [id=15099]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    def new generation total 576K, used 515K [0x88bc0000, 0x88c60000, 0x890a0000)
    eden space 512K, 95% used [0x88bc0000, 0x88c3a560, 0x88c40000)
    from space 64K, 40% used [0x88c40000, 0x88c46888, 0x88c50000)
    to space 64K, 0% used [0x88c50000, 0x88c50000, 0x88c60000)
    tenured generation total 1408K, used 918K [0x890a0000, 0x89200000, 0x8cbc0000)
    the space 1408K, 65% used [0x890a0000, 0x89185850, 0x89185a00, 0x89200000)
    compacting perm gen total 8192K, used 500K [0x8cbc0000, 0x8d3c0000, 0x90bc0000)
    the space 8192K, 6% used [0x8cbc0000, 0x8cc3d110, 0x8cc3d200, 0x8d3c0000)
    ro space 8192K, 68% used [0x90bc0000, 0x91142e10, 0x91143000, 0x913c0000)
    rw space 12288K, 48% used [0x913c0000, 0x91991640, 0x91991800, 0x91fc0000)
    Dynamic libraries:
    00113000-00121000 r-xp 00000000 03:01 6292457 /lib/tls/libpthread-2.3.4.so
    00121000-00123000 rwxp 0000d000 03:01 6292457 /lib/tls/libpthread-2.3.4.so
    00123000-00125000 rwxp 00123000 00:00 0
    0022c000-0023b000 r-xp 00000000 03:01 6292459 /lib/libresolv-2.3.4.so
    0023b000-0023d000 rwxp 0000f000 03:01 6292459 /lib/libresolv-2.3.4.so
    0023d000-0023f000 rwxp 0023d000 00:00 0
    002be000-002c5000 r-xp 00000000 03:01 6292458 /lib/libgcc_s-3.4.6-20060404.so.1
    002c5000-002c6000 rwxp 00007000 03:01 6292458 /lib/libgcc_s-3.4.6-20060404.so.1
    002e8000-003a8000 r-xp 00000000 03:01 10722848 /usr/lib/libstdc++.so.6.0.3
    003a8000-003ad000 rwxp 000bf000 03:01 10722848 /usr/lib/libstdc++.so.6.0.3
    003ad000-003b3000 rwxp 003ad000 00:00 0
    0087d000-0088f000 r-xp 00000000 03:01 6292465 /lib/libnsl-2.3.4.so
    0088f000-00891000 rwxp 00011000 03:01 6292465 /lib/libnsl-2.3.4.so
    00891000-00893000 rwxp 00891000 00:00 0
    00b99000-00bae000 r-xp 00000000 03:01 6292453 /lib/ld-2.3.4.so
    00bae000-00baf000 r-xp 00015000 03:01 6292453 /lib/ld-2.3.4.so
    00baf000-00bb0000 rwxp 00016000 03:01 6292453 /lib/ld-2.3.4.so
    00bb7000-00cdc000 r-xp 00000000 03:01 6292454 /lib/tls/libc-2.3.4.so
    00cdc000-00cdd000 r-xp 00124000 03:01 6292454 /lib/tls/libc-2.3.4.so
    00cdd000-00ce0000 rwxp 00125000 03:01 6292454 /lib/tls/libc-2.3.4.so
    00ce0000-00ce2000 rwxp 00ce0000 00:00 0
    00ce4000-00d05000 r-xp 00000000 03:01 6292455 /lib/tls/libm-2.3.4.so
    00d05000-00d07000 rwxp 00020000 03:01 6292455 /lib/tls/libm-2.3.4.so
    00d09000-00d0b000 r-xp 00000000 03:01 6292456 /lib/libdl-2.3.4.so
    00d0b000-00d0d000 rwxp 00001000 03:01 6292456 /lib/libdl-2.3.4.so
    08048000-08057000 r-xp 00000000 03:01 11715142 /usr/java/jdk1.5.0_15/bin/java
    08057000-08059000 rwxp 0000e000 03:01 11715142 /usr/java/jdk1.5.0_15/bin/java
    08059000-086b9000 rwxp 08059000 00:00 0
    88bc0000-88c60000 rwxp 88bc0000 00:00 0
    88c60000-890a0000 rwxp 88c60000 00:00 0
    890a0000-89200000 rwxp 890a0000 00:00 0
    89200000-8cbc0000 rwxp 89200000 00:00 0
    8cbc0000-8d3c0000 rwxp 8cbc0000 00:00 0
    8d3c0000-90bc0000 rwxp 8d3c0000 00:00 0
    90bc0000-91143000 r-xs 00001000 03:01 11698348 /usr/java/jdk1.5.0_15/jre/lib/i386/client/classes.jsa
    91143000-913c0000 rwxp 91143000 00:00 0
    913c0000-91992000 rwxp 00584000 03:01 11698348 /usr/java/jdk1.5.0_15/jre/lib/i386/client/classes.jsa
    91992000-91fc0000 rwxp 91992000 00:00 0
    91fc0000-92090000 rwxp 00b56000 03:01 11698348 /usr/java/jdk1.5.0_15/jre/lib/i386/client/classes.jsa
    92090000-923c0000 rwxp 92090000 00:00 0
    923c0000-923c4000 r-xs 00c26000 03:01 11698348 /usr/java/jdk1.5.0_15/jre/lib/i386/client/classes.jsa
    923c4000-927c0000 rwxp 923c4000 00:00 0
    b0500000-b0521000 rwxp b0500000 00:00 0
    b0521000-b0600000 --xp b0521000 00:00 0
    b0600000-b0636000 rwxp b0600000 00:00 0
    b0636000-b0700000 --xp b0636000 00:00 0
    b0700000-b0800000 rwxp b0700000 00:00 0
    b0873000-b0874000 --xp b0873000 00:00 0
    b0874000-b1c74000 rwxp b0874000 00:00 0
    b1c74000-b1c78000 r-xp 00000000 03:01 6291503 /lib/libnss_dns-2.3.4.so
    b1c78000-b1c7a000 rwxp 00003000 03:01 6291503 /lib/libnss_dns-2.3.4.so
    b1c94000-b1c97000 --xp b1c94000 00:00 0
    b1c97000-b1d15000 rwxp b1c97000 00:00 0
    b1d15000-b1d1b000 r-xs 00000000 03:01 10748120 /usr/lib/gconv/gconv-modules.cache
    b1fcb000-b1fdd000 r-xp 00000000 03:01 11603256 /usr/java/jdk1.5.0_15/jre/lib/i386/libnet.so
    b1fdd000-b1fde000 rwxp 00011000 03:01 11603256 /usr/java/jdk1.5.0_15/jre/lib/i386/libnet.so
    b1fde000-b1fe1000 --xp b1fde000 00:00 0
    b1fe1000-b205f000 rwxp b1fe1000 00:00 0
    b2089000-b214f000 r-xs 00000000 03:01 11698359 /usr/java/jdk1.5.0_15/jre/lib/ext/localedata.jar
    b214f000-b2152000 r-xs 00000000 03:01 11698358 /usr/java/jdk1.5.0_15/jre/lib/ext/dnsns.jar
    b2152000-b217d000 r-xs 00000000 03:01 11698357 /usr/java/jdk1.5.0_15/jre/lib/ext/sunpkcs11.jar
    b217d000-b21a4000 r-xs 00000000 03:01 11698356 /usr/java/jdk1.5.0_15/jre/lib/ext/sunjce_provider.jar
    b21a4000-b21a5000 --xp b21a4000 00:00 0
    b21a5000-b2225000 rwxp b21a5000 00:00 0
    b2225000-b2228000 --xp b2225000 00:00 0
    b2228000-b22a6000 rwxp b2228000 00:00 0
    b22a6000-b22a9000 --xp b22a6000 00:00 0
    b22a9000-b2327000 rwxp b22a9000 00:00 0
    b2327000-b232a000 --xp b2327000 00:00 0
    b232a000-b23a8000 rwxp b232a000 00:00 0
    b23a8000-b25a8000 r-xp 00000000 03:01 10717357 /usr/lib/locale/locale-archive
    b25a8000-b25ab000 --xp b25a8000 00:00 0
    b25ab000-b2629000 rwxp b25ab000 00:00 0
    b2629000-b262c000 --xp b2629000 00:00 0
    b262c000-b26aa000 rwxp b262c000 00:00 0
    b26aa000-b26ab000 --xp b26aa000 00:00 0
    b26ab000-b273c000 rwxp b26ab000 00:00 0
    b273c000-b2758000 rwxp b273c000 00:00 0
    b2758000-b2759000 rwxp b2758000 00:00 0
    b2759000-b2776000 rwxp b2759000 00:00 0
    b2776000-b2777000 rwxp b2776000 00:00 0
    b2777000-b2778000 rwxp b2777000 00:00 0
    b2778000-b277a000 rwxp b2778000 00:00 0
    b277a000-b2796000 rwxp b277a000 00:00 0
    b2796000-b279a000 rwxp b2796000 00:00 0
    b279a000-b27b6000 rwxp b279a000 00:00 0
    b27b6000-b27c5000 rwxp b27b6000 00:00 0
    b27c5000-b2841000 rwxp b27c5000 00:00 0
    b2841000-b2941000 rwxp b2841000 00:00 0
    b2941000-b4841000 rwxp b2941000 00:00 0
    b4841000-b50b0000 r-xs 00000000 03:01 11603318 /usr/java/jdk1.5.0_15/jre/lib/charsets.jar
    b50b0000-b50c5000 r-xs 00000000 03:01 11603283 /usr/java/jdk1.5.0_15/jre/lib/jce.jar
    b50c5000-b514a000 r-xs 00000000 03:01 11603316 /usr/java/jdk1.5.0_15/jre/lib/jsse.jar
    b514a000-b51b3000 rwxp b514a000 00:00 0
    b51b3000-b77db000 r-xs 00000000 03:01 11603320 /usr/java/jdk1.5.0_15/jre/lib/rt.jar
    b77db000-b77ea000 r-xp 00000000 03:01 11603253 /usr/java/jdk1.5.0_15/jre/lib/i386/libzip.so
    b77ea000-b77ec000 rwxp 0000e000 03:01 11603253 /usr/java/jdk1.5.0_15/jre/lib/i386/libzip.so
    b77ec000-b780d000 r-xp 00000000 03:01 11603251 /usr/java/jdk1.5.0_15/jre/lib/i386/libjava.so
    b780d000-b780f000 rwxp 00020000 03:01 11603251 /usr/java/jdk1.5.0_15/jre/lib/i386/libjava.so
    b780f000-b7818000 r-xp 00000000 03:01 6291506 /lib/libnss_files-2.3.4.so
    b7818000-b781a000 rwxp 00008000 03:01 6291506 /lib/libnss_files-2.3.4.so
    b7820000-b782b000 r-xp 00000000 03:01 11603250 /usr/java/jdk1.5.0_15/jre/lib/i386/libverify.so
    b782b000-b782c000 rwxp 0000b000 03:01 11603250 /usr/java/jdk1.5.0_15/jre/lib/i386/libverify.so
    b782c000-b7834000 rwxs 00000000 03:01 6619137 /tmp/hsperfdata_myname/15092
    b7834000-b783a000 r-xp 00000000 03:01 11603246 /usr/java/jdk1.5.0_15/jre/lib/i386/native_threads/libhpi.so
    b783a000-b783b000 rwxp 00006000 03:01 11603246 /usr/java/jdk1.5.0_15/jre/lib/i386/native_threads/libhpi.so
    b783b000-b783c000 rwxp b783b000 00:00 0
    b783c000-b783d000 r-xp b783c000 00:00 0
    b783d000-b7baf000 r-xp 00000000 03:01 11698345 /usr/java/jdk1.5.0_15/jre/lib/i386/client/libjvm.so
    b7baf000-b7bcd000 rwxp 00372000 03:01 11698345 /usr/java/jdk1.5.0_15/jre/lib/i386/client/libjvm.so
    b7bcd000-b7fe6000 rwxp b7bcd000 00:00 0
    bfe00000-bfe03000 --xp bfe00000 00:00 0
    bfe03000-c0000000 rwxp bfe03000 00:00 0
    ffffe000-fffff000 ---p 00000000 00:00 0
    VM Arguments:
    jvm_args: -Xcheck:jni -XX:+PrintCompilation
    java_command: myapplication
    Launcher Type: SUN_STANDARD
    Environment Variables:
    PATH=/home/myname/XXXXXXXX_PERF/bin:/usr/java/jdk1.5.0_15/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/myname/bin
    LD_LIBRARY_PATH=/usr/java/jdk1.5.0_15/jre/lib/i386/client:/usr/java/jdk1.5.0_15/jre/lib/i386:/usr/java/jdk1.5.0_15/jre/../lib/i386:/home/myname/XXXXXXXX/lib
    SHELL=/bin/bash
    DISPLAY=XXX.XXX.X.XXX:0.0
    Signal Handlers:
    SIGSEGV: [libjvm.so+0x32b740], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
    SIGBUS: [libjvm.so+0x32b740], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
    SIGFPE: [libjvm.so+0x28ef10], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
    SIGPIPE: [libjvm.so+0x28ef10], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
    SIGILL: [libjvm.so+0x28ef10], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
    SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
    SIGUSR2: [libjvm.so+0x291360], sa_mask[0]=0x00000000, sa_flags=0x14000004
    SIGHUP: [libjvm.so+0x290d90], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
    SIGINT: [libjvm.so+0x290d90], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
    SIGQUIT: [libjvm.so+0x290d90], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
    SIGTERM: [libjvm.so+0x290d90], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
    --------------- S Y S T E M ---------------
    OS:Red Hat Enterprise Linux WS release 4 (Nahant Update 4)
    uname:Linux 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:27:17 EDT 2006 i686
    libc:glibc 2.3.4 NPTL 2.3.4
    rlimit: STACK 20480k, CORE 0k, NPROC 16375, NOFILE 1024, AS infinity
    load average:3.46 1.36 0.50
    CPU:total 2 (cores per cpu 1, threads per core 2) family 15 model 4 stepping 1, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ht
    Memory: 4k page, physical 1034096k(389000k free), swap 0k(0k free)
    vm_info: Java HotSpot(TM) Client VM (1.5.0_15-b04) for linux-x86, built on Feb 9 2008 01:37:00 by java_re with gcc 3.2.1-7a (J2SE release)
    Regards
    Fr�d�ric

    Simple - something is wrong with your C/C++ code.
    You have a pointer/memory bug.

  • Memory Allocation problem when using JNI

    For a Project we need to interface Labwindows-CVI/ Teststand with an application written in Java. we are using JNI. The code uses JNI_CreateJavaVM to start a JVM to run the Java interface code. The code did run for some time , but now ( without any obvious change nor on the CVI side neither on the Java side) JNI_CreateJavaVM fails with -4 error code, that means that the start of the JVM failed due to memory allocation failure. First investigation showed, that even if Windows Task Manager shows about 600M free physical memory, you can allocate in CVI only about 250M as a single block at the time we are calling  JNI_CreateJavaVM. That might be a little bit to less as we need to pass -Xmx192m to the JVM to run our code. Unfortunately just increasing the physical memory of that machine from 1.5G to 2G doesn't change anything. The free memory showed by Task Manager increases, but the allocatable memory block size does not. Are the any trick to optimize CVI/Teststand for that use case ?  Or maybe known problems with JNI ?
    Solved!
    Go to Solution.

    hi,
    have you tried other functions to allocate memory?
    the -Xmx command only sets the maximum heap size. You can try to use -Xms. This command sets the initial Java heap size. 

  • JButton not rendering properly when using JNI

    Hi,
    Has anyone ever invoked a JNI method through a java GUI only to find that the GUI is not properly repainting itself. In my case, my buttons become gray and the text becomes unbolded and blue. Its a very odd problem, isn't it? This occurs when I am porting Matlab code to C++ and then C++ to java. Any help that can help me proceed is appreciated!
    P.S. Could this have anything to do with Concurrency?
    Thanks.

    ejp wrote:
    So what does the JNU code do? Currently the code involves some Image Processing. But I'm certain what it does could not be the source of the problem as I have tried code as simple as y=x*10; in my Matlab compiled code.
    ejp wrote:
    and does anything else in the system wait for it? or synchronize against it? or join the thread you are starting? This code is dispatched by a background worker thread using an Executor object initialized by Executors.newFixedThreadPool(10). Originally it blocked the EDT. Nothing in my code has synchronous blocks or blocks (join) the thread I'm starting.
    jschell wrote:
    Stub out the JNI code. Have the methods do nothing or return a hard code reasonable data set.jschell, my method was to force the EDT to sleep for about 4 seconds, and then another test when I made it sleep for 30 seconds.
    When the thread stopped sleeping in both cases, no glitch was found. This suggests that the issue is in the JNI code. When I put a delay in the dispatched thread run() method, this delay was seen in the GUI. This tells me that the two threads were not completely separated, which would eventually causes a problem. Can someone tell me how to properly dispatch a thread from the GUI's EDT. I believe this would help me further. Does the SwingWorker class do this?
    Thanks.

  • Compile problem when using JNI in c program.

    I am run JDK 1.4 on AIX 5.1. I am trying to compile following code.
    #include <jni.h>
    main() {
    JNIEnv *env;
    JavaVM *jvm;
    JDK1_1InitArgs vm_args;
    jint res;
    jclass cls;
    jmethodID mid;
    jstring jstr;
    jobjectArray args;
    /* IMPORTANT: specify vm_args version # if you use JDK1.1.2 and beyond */
    vm_args.version = 0x00010001;
    JNI_GetDefaultJavaVMInitArgs(&vm_args);
    res = JNI_CreateJavaVM(&jvm,&env,&vm_args);
    if (res < 0) {
    fprintf(stderr, "Can't create Java VM\n");
    exit(1);
    cls = (*env)->FindClass(env, "Prog");
    if (cls == 0) {
    fprintf(stderr, "Can't find Prog class\n");
    exit(1);
    mid = (*env)->GetStaticMethodID(env, cls, "main", "([Ljava/lang/String;)V");
    if (mid == 0) {
    fprintf(stderr, "Can't find Prog.main\n");
    exit(1);
    jstr = (*env)->NewStringUTF(env, " from C!");
    if (jstr == 0) {
    fprintf(stderr, "Out of memory\n");
    exit(1);
    args = (*env)->NewObjectArray(env, 1,
    (*env)->FindClass(env, "java/lang/String"), jstr);
    if (args == 0) {
    fprintf(stderr, "Out of memory\n");
    exit(1);
    (*env)->CallStaticVoidMethod(env, cls, mid, args);
    (*jvm)->DestroyJavaVM(jvm);
    I run this command command and get the following errors
    gcc invoke.c -o invoke -I/usr/java14/include -I/usr/java14/jre/bin -L/usr/java14/jre/bin -Lusr/java14/jre/bin/classic/
    ld: 0711-317 ERROR: Undefined symbol: .JNI_GetDefaultJavaVMInitArgs
    ld: 0711-317 ERROR: Undefined symbol: .JNI_CreateJavaVM
    I think I having all the location for the correct libraries or am I missing one.

    You must include the aix sub-folder and the main include folder:
    -I/usr/java14/include/aix -I/usr/java14/include
    (No need to include the bin folder)

  • Error when I use JNI

    Hi
    I�m developming a wrapper in C because I need to call C�methods of the scanner�drivers
    but when I run the java�code (the java�code call a JNI function that call the scanner drivers in C)
    I get the following error:
    C:\Documents and Settings\yamilet\Mis documentos\pruebaJNI\Scanner\escaner>java
    Scanner
    Valor devuelto por la funcion Open: 0
    # An unexpected error has been detected by HotSpot Virtual Machine:
    # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x02ca55ea, pid=2692, tid=4092
    # Java VM: Java HotSpot(TM) Client VM (1.5.0_02-b09 mixed mode, sharing)
    # Problematic frame:
    # C [LS100.dll+0x55ea]
    # An error report file with more information is saved as hs_err_pid2692.log
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    Anybody have any idea about this error?
    Please help me
    Thank for advance

    The problem occurs the same way with or without breakpoints (MessageBoxes) in my code. Without any message boxes in the application, the values sent are retrieved, processed and the result sent back by the native method before the error shows up. I even do a println in the Java code of the result sent back before the error shows up.
    It appears that it is something about the creation of the COM component that is causing the JRE to fail. Interestingly, I have been running this appliction (same client code making use of COM components) for some time now using a C++ front end to pass the data with absolutely no problem. The only difference now is that I am using a Java front end and passing the data using JNI. As I wrote earlier, I have used the -Xcheck:jni option with no error reported. I have even use JRE 6 with the
    -XX:-RelaxAccessControlCheck option. That does not help.

  • Guidelines for when to use JNI

    I didn't find an answer to this in any FAQ or the 2 JNI books I have, so apologies in advance if this is a common question whose answer has already been posted -
    Do any guidelines exist for when, and to what extent, JNI should be used?
    I'm currently working on my second project where the question of whether or not to use it has come up. Both projects were distributed and contained both C++ and Java code in different areas. The issue came up when the need arose to implement a new shared library that had to be used by both C++ and Java code. Logging and configuration services are examples of the new functionality.
    The choice is whether to implement the new libraries primarily in C++ and supply a Java interface, via JNI, for Java code which needs to use it, or to implement the new libraries in both C++ and Java to support both types of clients.
    On the previous project, a team member had extensive JNI experience and recommended the dual language implementation approach instead of JNI. This worked out ok except we did have to have to ensure the new library developer was skilled in both C++ and Java, and he had to be sure to update both when changes to 1 were necessary - a maintenance problem. The experienced JNI developer made this recommendation due to issues he had encountered previously - most notably issues related to errors in the native code which brought down the JVM.
    On the current project, we're opting for base C++ implementations with JNI wrappers. That's making me somewhat nervous since the alternative seems safer.
    What do other developers think?

    Have you checked out www.javaworld.com. They usually have very good and in-depth articles. IMHO, it all depends on the sort of use your library is intended for. If its used extensively by native code, use C++ with a Java wrapper. It its the other way around, implement it in Java and use a JNI interface for native code. I would really consider this carefully before implementing stuff in C++ that is used from Java. First of all, Java is after all much simpler than C++, its a more elgant OO-language and you have the platform neutrality. On the other hand, C++ has its sides. I dont use JNI unless its absolutely neccessary, in situations like using legacy code.
    These are just a few of my thoughts, hope it gives you some hints.

  • Deploying a WAR file containing .jsp and servlets (also uses JNI)

    Deploying a WAR file containing .jsp and servlets (also uses JNI) on Windows 2000
    We had problems making it initially work on Sun ONE Web Server 6.0 Service Pack 1 because of lack of good iPlanet Web
    Server documentation on deploying such files.
    This is how we went about it:
    1) Make one of the servlet and JSP (must call another Java Class) web application (.war) examples work with iPlanet Web
    Server.
    C:\iPlanet\Servers\plugins\servlets\examples\web-apps\HelloWorld\HelloWorld.war
    and
    C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    a) Go to your Web Server Administration to deploy the application using GUI Web Application Deploy.
    (We usually use command line, we experienced some issues with the GUI version, but maybe it is fixed in the new Web Server
    service packs)
    From browser, open http://yourserver:8888/
    Click on Select a Server:Manage
    Click on Virtual Server Class
    Click on https-yourserver
    Click on the Web Applications Tab
    Then, click on Deploy Web Application
    Enter the following -
    WAR File On: Local
    WAR File Path: C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    Application URI: /jakarta
    Installation Directory: c:\iPlanet\examples\jakarta-examples
    By clicking on OK it deployed the application.
    I can verify that it is deployed by selecting "Edit Web Applications" and I see the following entry:
    Edit     /jakarta     c:/iPlanet/examples/jakarta-examples
    Also, c:/iPlanet/examples/jakarta-examples should have the similar following directory structure ..
    - [images]
    - [jsp]
    - index.html
    - [servlets]
    - [META-INF]
    - [WEB-INF]
    - [classes]
    - [tlds]
    - web.xml
    - index.html
    I restarted the server and accessed it using the following URL from my IE browser:
    http://yourserver/jakarta/index.html
    Then I clicked on the JSP Examples and tried some JSP examples.
    b) Alternatively, you can also deploy the same example from the command-line.
    Make sure C:\iPlanet\Servers\bin\https\httpadmin\bin\ is in your path
    wdeploy deploy      -u /jakarta
              -i yourserver
              -v https-yourserver
              -d c:\iplanet\examples\jakarta-examples
              C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    Restart the web server (I don't think you have to restart, but .. might as well).
    2)Deploy your web-application
    My Foo.war has the following structure.
    You can use jar tf Foo.war to look at the file contents from command line (assuming you have JDK installed and the bin is
    in your PATH)
    Foo.war
    - [META-INF]
    - [WEB-INF]
    - web.xml
    - [classes]
    - Bar.class
    - MoServlet.class
    - [lib]
    - ThirdParty.jar
    - [natlib]
    - extlib.dll
    - foo.jsp
    Here is our application scenario:
    foo.jsp uses a class call Bar (it is not in any package). The Bar java class uses classes from ThirdParty.jar. The
    ThirdParty.jar in turn uses JNI to load library extlib.dll. foo.jsp also calls /servlet/Mo as well.
    Now to deploy it, do the following:
    (a) Make sure that within foo.jsp, you import the Bar class ( I don't know why you have to do it, but if you don't you get
    JSP compile error).
    <%@page language="java" import="Bar" contentType="text/html"%>
    (b) Check web.xml (for Servlets)
    Within web.xml, make sure you have the following mappings:
    <servlet>
    <servlet-name> MoLink </servlet-name>
    <servlet-class> MoServlet </servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name> MoLink </servlet-name>
    <url-pattern> /servlet/Mo </url-pattern>
    </servlet-mapping>
    (c) Deploy the application
    Using command line:
    wdeploy deploy      -u /foo
              -i yourserver
              -v https-yourserver
              -d c:\iplanet\examples\foo-dir
              Foo.war
    (d) Change web-apps.xml file (for picking up ThirdParty.jar)
    It is located in
    C:\iPlanet\Servers\https-yourserver\config
    You should see something similar to following after successful deployment.
    <web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true"/>
    Change it to look like following to pick up the ThirdParty.jar
    <web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true">
    <class-loader reload-interval="300"
              classpath="C:/iPlanet/examples/foo-dir/WEB-INF/lib/ThirdParty.jar"
              delegate="false"/>
    </web-app>
    (e) Change jvm12.conf file (for JNI)
    It is located in
    C:\iPlanet\Servers\https-yourserver\config
    Add or uncomment the following lines:
    #optional - just helps with instrumenting the jsp and servlet code
    jvm.include.CLASSPATH=1
    jvm.enableDebug=1
    nes.jsp.enabledebug=1
    jvm.trace=7
    jvm.verboseMode=1
    #required for JNI
    java.compiler=NONE
    jvm.classpath=.;C:\JDK1.3.1\lib\tools.jar;C:/iPlanet/Servers/plugins/servlets/examples/legacy/beans.10/SDKBeans10.jar;
    jvm.option=-Xrs
    jvm.option=-Xnoagent
    # not sure if this is needed for iPlanet web server
    jvm.option=-Djava.library.path=C:/iPlanet/examples/foo-dir/natlib/ -Djava.compiler=NONE
    (f) Change magnus.conf file (for JNI)
    We HAD to change this file in order for ThirdParty.jar file to pick up the native C++ code using JNI. Apparently, the
    iPlanet Web Server doesn't pick the Environment Variable Path. Because when we had the directory containing the DLL just
    in Path, it didn't work.
    Change Extrapath directive:
    ExtraPath C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
    to
    ExtraPath c:/iPlanet/examples/foo-dir/natlib;C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
    (g) Apply changes from the Web Server Administration Console and Restart the web server.
    You should be able to see the behaviour that you want from your application.
    http://yourserver/foo/foo.jsp
    Hope this was helpful!!!
    Sonu

    Deploying a WAR file containing .jsp and servlets (also uses JNI) on Windows 2000
    We had problems making it initially work on Sun ONE Web Server 6.0 Service Pack 1 because of lack of good iPlanet Web
    Server documentation on deploying such files.
    This is how we went about it:
    1) Make one of the servlet and JSP (must call another Java Class) web application (.war) examples work with iPlanet Web
    Server.
    C:\iPlanet\Servers\plugins\servlets\examples\web-apps\HelloWorld\HelloWorld.war
    and
    C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    a) Go to your Web Server Administration to deploy the application using GUI Web Application Deploy.
    (We usually use command line, we experienced some issues with the GUI version, but maybe it is fixed in the new Web Server
    service packs)
    From browser, open http://yourserver:8888/
    Click on Select a Server:Manage
    Click on Virtual Server Class
    Click on https-yourserver
    Click on the Web Applications Tab
    Then, click on Deploy Web Application
    Enter the following -
    WAR File On: Local
    WAR File Path: C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    Application URI: /jakarta
    Installation Directory: c:\iPlanet\examples\jakarta-examples
    By clicking on OK it deployed the application.
    I can verify that it is deployed by selecting "Edit Web Applications" and I see the following entry:
    Edit     /jakarta     c:/iPlanet/examples/jakarta-examples
    Also, c:/iPlanet/examples/jakarta-examples should have the similar following directory structure ..
    - [images]
    - [jsp]
    - index.html
    - [servlets]
    - [META-INF]
    - [WEB-INF]
    - [classes]
    - [tlds]
    - web.xml
    - index.html
    I restarted the server and accessed it using the following URL from my IE browser:
    http://yourserver/jakarta/index.html
    Then I clicked on the JSP Examples and tried some JSP examples.
    b) Alternatively, you can also deploy the same example from the command-line.
    Make sure C:\iPlanet\Servers\bin\https\httpadmin\bin\ is in your path
    wdeploy deploy      -u /jakarta
              -i yourserver
              -v https-yourserver
              -d c:\iplanet\examples\jakarta-examples
              C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    Restart the web server (I don't think you have to restart, but .. might as well).
    2)Deploy your web-application
    My Foo.war has the following structure.
    You can use jar tf Foo.war to look at the file contents from command line (assuming you have JDK installed and the bin is
    in your PATH)
    Foo.war
    - [META-INF]
    - [WEB-INF]
    - web.xml
    - [classes]
    - Bar.class
    - MoServlet.class
    - [lib]
    - ThirdParty.jar
    - [natlib]
    - extlib.dll
    - foo.jsp
    Here is our application scenario:
    foo.jsp uses a class call Bar (it is not in any package). The Bar java class uses classes from ThirdParty.jar. The
    ThirdParty.jar in turn uses JNI to load library extlib.dll. foo.jsp also calls /servlet/Mo as well.
    Now to deploy it, do the following:
    (a) Make sure that within foo.jsp, you import the Bar class ( I don't know why you have to do it, but if you don't you get
    JSP compile error).
    <%@page language="java" import="Bar" contentType="text/html"%>
    (b) Check web.xml (for Servlets)
    Within web.xml, make sure you have the following mappings:
    <servlet>
    <servlet-name> MoLink </servlet-name>
    <servlet-class> MoServlet </servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name> MoLink </servlet-name>
    <url-pattern> /servlet/Mo </url-pattern>
    </servlet-mapping>
    (c) Deploy the application
    Using command line:
    wdeploy deploy      -u /foo
              -i yourserver
              -v https-yourserver
              -d c:\iplanet\examples\foo-dir
              Foo.war
    (d) Change web-apps.xml file (for picking up ThirdParty.jar)
    It is located in
    C:\iPlanet\Servers\https-yourserver\config
    You should see something similar to following after successful deployment.
    <web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true"/>
    Change it to look like following to pick up the ThirdParty.jar
    <web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true">
    <class-loader reload-interval="300"
              classpath="C:/iPlanet/examples/foo-dir/WEB-INF/lib/ThirdParty.jar"
              delegate="false"/>
    </web-app>
    (e) Change jvm12.conf file (for JNI)
    It is located in
    C:\iPlanet\Servers\https-yourserver\config
    Add or uncomment the following lines:
    #optional - just helps with instrumenting the jsp and servlet code
    jvm.include.CLASSPATH=1
    jvm.enableDebug=1
    nes.jsp.enabledebug=1
    jvm.trace=7
    jvm.verboseMode=1
    #required for JNI
    java.compiler=NONE
    jvm.classpath=.;C:\JDK1.3.1\lib\tools.jar;C:/iPlanet/Servers/plugins/servlets/examples/legacy/beans.10/SDKBeans10.jar;
    jvm.option=-Xrs
    jvm.option=-Xnoagent
    # not sure if this is needed for iPlanet web server
    jvm.option=-Djava.library.path=C:/iPlanet/examples/foo-dir/natlib/ -Djava.compiler=NONE
    (f) Change magnus.conf file (for JNI)
    We HAD to change this file in order for ThirdParty.jar file to pick up the native C++ code using JNI. Apparently, the
    iPlanet Web Server doesn't pick the Environment Variable Path. Because when we had the directory containing the DLL just
    in Path, it didn't work.
    Change Extrapath directive:
    ExtraPath C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
    to
    ExtraPath c:/iPlanet/examples/foo-dir/natlib;C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
    (g) Apply changes from the Web Server Administration Console and Restart the web server.
    You should be able to see the behaviour that you want from your application.
    http://yourserver/foo/foo.jsp
    Hope this was helpful!!!
    Sonu

  • Call to a C++ DLL, using JNI - C++ method has char*

    I am trying to link into an existing C++ Dynamically Linked Library(DLL) using the Java Native Interface(JNI).
    All goes fine, and the library loads into the current program, however when I try to call the function, it crashes. The function has char pointers, and I haven;t been able to get Java to simulate them. Is there a way?????
    I have tried using and array of chars .....char[], and String, but no dice.
    Any suggestions O'learned Java ones??

    It will be necessary for you to write a JNI adapter in C/C++ to accomplish this. Java character strings and arrays are very different from those of C/C++ and you'll have to use JNI functions to adapt.
    Chuck

  • Trouble using JNI

    Hi everyone
    I have a problem, with a class which has native functions(JNI).
    The application I�m developing, uses thread�s. At the beginning before thread starts his job, application calls a native function without problem. But when another thread calls another native function(same class) generates the next error :
    java.lang.UnsatisfiedLinkError: estarEnEjecucion
    at MemoriaCompartida.estarEnEjecucion(Native Method)
    at MemoriaCompartida.estarEnEjecucion(MemoriaCompartida.java:72)
    at Censor.timerIntervalo(Censor.java:82)
    at Timer.run(Timer.java:225)
    at java.lang.Thread.run(Thread.java:534)
    What seems to be the problem???
    Thanks a lot for your help

    First of all,
    when I use JNI, I like to put the System.loadLibrary() on a static method in the first class I know will be loaded.
    like this:
    static {
        System.loadLibrary("Name");
    }So I know that Library was succesfuly loaded.
    Anyway, I bet that your library do NOT have the method you are trying to access, or maybe is missing parameters!
    Check it!
    If I didn't helped, please put the call of the methods in the java file and the library, if you can.
    Cya...
    Message was edited by:
    pbulgarelli
    Message was edited by:
    pbulgarelli

  • Using JNI with RMI/EJB.

    Hi,
    I am using JNI to interface with a c application.
    The problem is that c application is thread safe.
    Since i need to use this interface from RMI/EJB,
    multiple calls will be made simultaneosly on the
    c application.
    Will anyone tell me how do i handle this scenario?
    Thanks in Advance.
    Robin

    Is the ejb expect immediate result from the c application?
    If yes, I don't know. Perhaps you need to redesign your business logic so it will not expect immediate result from c.
    If no, then make a layer between the ejb and c. The layer would be message queuer application with JMS receiver. EJB will send JMS to the JMS receiver when it needs to execute c. You can queue the message so c application is executed without overlap. If the EJB expect the result from c, then the queuer can send it back using JMS.

Maybe you are looking for

  • HT4623 How do I get the WiFi back with the new ios6 update for Iphone 4?

    I updated to the new iOS6 last night and I can't get the WiFi to connect.  I've read today Steve Streza, lead platform developer for Pocket.com, a San Francisco app vendor, outlined the issues. "Your phone checks a page on http://Apple.com to see if

  • How do I transfer itunes music and apps from PC to new iMac

    I'm setting up my new imac and I'm trying to figure out how to transfer my iphone apps to the imac. I've transferred the music over but I'm stumped on the apps. A little help for a mac newbie?

  • Wireless music playback from iPhone via home-stereo

    I want to listen to my music, playing on my iPhone, using my home-stereo as speakers. I'm looking so to speak for a wireless iPhone-Dock, or a wlan/bluetooth-receiver with audio out (and matching app), or a airport-extreme that syncs with my iPhone.

  • Lost Files -- How to Locate and Update iTunes

    I re-organized about 450 of my iTunes files and now get erorr messages that iTunes cannot locate the files.  I can then find them, manyually one by one.  Is there any way to automate this painful process?

  • Vendor Auto Mail Information

    Hi QM Gurus, My client requirement is Scenario 1:  Once procurement goods rejected in Quality that time rejection information (Defect details, UD details, Accepted qty, rejected qty) send to vendor as well as concern vendor follow up person automatic