Using JNI_CreateJavaVM

What do I have to link into my cpp program to use the JNI_CreateJavaVM function? I can't seem to find it...

Hi Kabilesh,
Could you please let me know the exast soution u had for this?
I even set the SHLIB_PATH in the environment, but still this problem persists.
I am compiling the program and making into a shared library as
cc -c -g -n +z -I$JAVA_HOME/include -I$JAVA_HOME/include/hp-ux -L/opt/java1.4/jre/lib/PA_RISC2.0/server -ljvm Test.c -o Test.o
ld -b Test.o -L/opt/java1.4/jre/lib/PA_RISC2.0/server -ljvm -o Test.slMy java code is looks like this :
void create_Jvm()
    JNIEnv * env;
    JavaVM * jvm;
    //JDK1_1InitArgs vm_args;
    /* Note : In JNI1.2 and Java2 SDK 1.4, the new structure JavaVMInitArgs has been introduced.*/
    JavaVMInitArgs vm_args;
    //JavaVMOption options[1];
    jint res;
    vm_args.nOptions = 0;
    vm_args.ignoreUnrecognized = JNI_TRUE;
    /* IMPORTANT: specify vm_args version # if you use JDK1.1.2 and beyond */
    vm_args.version = JNI_VERSION_1_4;
    //vm_args.version = JNI_VERSION_1_2;
    /*In JNI1.2 and Java2 SDK 1.4 the JNI_GetDefaultJavaVMInitArgs method call is not required.*/
    //JNI_GetDefaultJavaVMInitArgs( & vm_args);
    res = JNI_CreateJavaVM( &jvm, (void**)&env, &vm_args);
    if (res < 0) {
        fprintf(stderr, "Can't create Java VM\n Error is :%ld\n ", res);
        exit(1);
    iJvmInitialized = 1;
} hi
Check the lib path
May be u have not included : at the end of the lib
path that u have added
THis was the mistake that i did
kabilesh

Similar Messages

  • Help with JDPA failure on JVM Startup from C++ using JNI_CreateJavaVM

    The short version:
    When I try to start a jvm with the -Xrunjdwp from C++ using JNI_CreateJavaVM and the following settings, it simply crashes. I can run my program just fine when this option is not present.
    JavaVMOption aoOptions[5];     
    aoOptions[0].optionString = m_ustrClassPath.GetStringA();
    aoOptions[1].optionString = "-Xdebug";
    aoOptions[2].optionString = "-Xnoagent";
    aoOptions[3].optionString = "-Djava.compiler=NONE";
    aoOptions[4].optionString = "-Xrunjdwp:transport=dt_socket,address=localhost:8000,server=y,suspend=n";
    I have all the appropriate jar files on the classpath and the DLL's are on the path. I am running 1.4.2. I have also tried dt_shmem and a combination of most of the adjustable paramaters being on/off or not present. Any help would be greatly appreciated!!!
    Thanks,
    Chris
    The long version (or why I want to do this crazy thing):
    I am migrating a product line from Visual Basic/C++/COM to Java. I recently purchased JBuilder 9 with the hope that I could use the attach to running JVM process to debug fully. When I attempted to add the neccessary options, my jvm create dies. I can't get to a point to attach from JBuilder.

    I have finally found a solution...
    Please see this bug: http://developer.java.sun.com/developer/bugParade/bugs/4335526.html
    The bug has not been fixed but a workaround exists. Please see the bug for full information, the short answer is this.
    When using the below settings, the -Xrun option is causing an Access Exception crash within jvm.dll. This seems to be because the -Xrun string is modified within jvm.dll.
    JavaVMOption aoOptions[5];
    aoOptions[0].optionString = m_ustrClassPath.GetStringA();
    aoOptions[1].optionString = "-Xdebug";
    aoOptions[2].optionString = "-Xnoagent";
    aoOptions[3].optionString = "-Djava.compiler=NONE";
    aoOptions[4].optionString = "-Xrunjdwp:transport=dt_socket,address=localhost:8000,server=y,suspend=n";
    The solution that worked for me was to use strdup as indicated in the workaround for the bug.
    JavaVMOption aoOptions[5];     
    pTempStrOption = m_ustrClassPath.GetStringA();
    aoOptions[0].optionString = strdup(pTempStrOption);
    aoOptions[1].optionString = strdup("-Xdebug");
    aoOptions[2].optionString = strdup("-Xnoagent");
    aoOptions[3].optionString = strdup("-Djava.compiler=NONE");
    aoOptions[4].optionString = strdup("-Xrunjdwp:transport=dt_socket,address=3333,server=y");
    This has caused me grief for months. It was not easy to locate in the bug database. It existed in 1.3 and still exists as of 1.4.2. I am not sure about the 1.5 beta.

  • I can't create the JVM using JNI_CreateJavaVM

    I'm very much new to the JNI on Windows 2000. When I compiled the example invoke.c program that invoke the java program, it generated invoke.exe file. but when I run the this executable file, it always shows "Can't create Java VM". I tried other samples, but the result is same. I am also sure that I copy jvm.dll from jdk1.2.2\jre\bin\classic to the same folder with invoke.exe file.
    I use JDK1.2.2 and Microsoft Visual Studio 6.0 C++. Please let me know what's going on about the following program?
    #include <jni.h>
    #define USER_CLASSPATH "." /* where Prog.class is */
    int main() {
    JNIEnv *env;
    JavaVM *jvm;
    jint res;
    jclass cls;
    jmethodID mid;
    jstring jstr;
    jclass stringClass;
    jobjectArray args;
    JavaVMInitArgs vm_args;
    JavaVMOption options[1];
    options[0].optionString =
    "-Djava.class.path=" USER_CLASSPATH;
    vm_args.version = JNI_VERSION_1_2;
    vm_args.options = options;
    vm_args.nOptions = 1;
    vm_args.ignoreUnrecognized = JNI_TRUE;
    /* Create the Java VM */
    res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
    if (res < 0) {
    fprintf(stderr, "Can't create Java VM\n");
    exit(1);
    cls = (*env)->FindClass(env, "Prog");
    if (cls == 0) {
    goto destroy;
    mid = (*env)->GetStaticMethodID(env, cls, "main",
    "([Ljava/lang/String;)V");
    if (mid == 0) {
    goto destroy;
    jstr = (*env)->NewStringUTF(env, " from C!");
    if (jstr == 0) {
    goto destroy;
    stringClass = (*env)->FindClass(env, "java/lang/String");
    args = (*env)->NewObjectArray(env, 1, stringClass, jstr);
    if (args == 0) {
    goto destroy;
    (*env)->CallStaticVoidMethod(env, cls, mid, args);
    destroy:
    if ((*env)->ExceptionOccurred(env)) {
    (*env)->ExceptionDescribe(env);
    (*jvm)->DestroyJavaVM(jvm);
    return 0;

    Are you sure you are using the correct jvm.dll?
    Remove any jvm.dll files you copied to your .exe directory and set your Path so that is using the jdk1.3 hotspot jvm.dll.
    You said you were using windows so the default location of your jdk is C:\jdk1.3.1 To set your path to the correct location use this command:
    set Path=%Path%;C:\jdk1.3.1\jre\bin\hotspot
    If your jdk is installed somewhere else replace C:\jdk1.3.1 with the root path to your jdk.
    If that doesn't work there may be a conflict with the way you compiled the program.

  • Space in "Program Files" causing JNI_CreateJavaVM to fail

    JNI experts:
    I'm launching a VM from a .exe (Win2000) written in C using MSVC and using JNI_CreateJavaVM. I'd like to specify the location of my installed jar file using the
    -Djava.class.path=path as an optionString in an options element of JavaVMInitArgs.
    All works wonderfully. Congratulations to all those who made JNI happen :)
    So... there's one problem. When my jar file is installed in c:\Program Files\xyz\myfile.jar the JVM fails to find it. When installed in c:\xyz\myfile.jar the JVM finds it and all is well.
    It looks like this: "-Djava.class.path=c:\Program Files\..."
    So I'm rather convinced the space between Program and Files is causing the problem. I've tried many hacks and searched the web and newsgroups to a large degree... with no luck.
    This is jdk1.3 and I've tried both JDK and JRE dlls:
    c:\Program Files\JavaSoft\JRE\1.3.0_0\bin\hotspot\jvm.dll
    and
    c:\jdk1.3\bin\hotspot\jvm.dll
    I've also tried classic instead of hotspot.
    Any clues would be helpful. Or, can I get access to the JVM code (I know that much of the Java implementation is available in various locations). I'm sure after dissecting that I could find the problem.
    Also, installing the .jar file in a directory without spaces in the name is unacceptable :(
    Thanks much...
    -Clint

    Ok, I've found the problem. For reference:
    1. Use the ext directories (jre/lib/ext). However, this won't work when using older JVMs. Which I'm attempting to provide backward compatibility.
    OR
    2. The java.class.path system property must contain entire path of a jar file, not just a directory containing the jar files of interest.
    ALSO
    3. An odd behavior. When the java.class.path system property contains an invalid path, the JVM seems to add the current working directory (the directory from where the JVM was initated) to the java.class.path property. For instance, I had:
    -Djava.class.path=c:\test;c:\testBad;
    where c:\testBad is not an actual directory. This will make the JVM look in the CWD to look for class files. Or so that is the behavior that I witnessed. Go figure...
    -Clint

  • Remote JNI_CreateJavaVM call

    Hi everyone.
    I have been running for some time a JNI based application. It begins as a C++ based program, and launches JVM at some points of the program to show graphical information. I use Swing components to achieve application requirements and it works properly.
    I'd like to know if it's possible to launch JVM (using JNI_CreateJavaVM or other functions) on a computer different from the one C++ program is being executed. So I could send visual information to different computers without C++ EXE and JAR files distribution, and without the need to run the program every time a computer needs the information.
    I have been reading RMI issues, Servlets, etc. But I think they don't match my needs because the JNI requierement.
    Thanks in advance.
    Ignasi Villagrasa.

    Hi everyone.
    I have been running for some time a JNI based
    application. It begins as a C++ based program, and
    launches JVM at some points of the program to show
    graphical information. I use Swing components to
    achieve application requirements and it works
    properly.
    I'd like to know if it's possible to launch JVM
    (using JNI_CreateJavaVM or other functions) on a
    computer different from the one C++ program is being
    executed. So I could send visual information to
    different computers without C++ EXE and JAR files
    distribution, and without the need to run the program
    every time a computer needs the information.No, not as stated.
    Remote computers never execute applications remotely. What happens is that a 'process' on a remote computer responds to a 'request' from a client and starts up an application on the remote computer.
    So you have to have something already running on the remote computer to start anything.
    There are common tools called remote command shells which allow you to do this. To use one of these in java the following conditions would have to be true:
    -The remote command shell server is installed on the remote machine.
    -You can access it from the client machines (firewall issues.)
    -You write an interface in java that simulates a client remote shell interface.
    Alternatively you could just presume that your process is already running on the remote machine. It waits for requests from a client, runs it, and sends the results back. And that leads into some of the other stuff that you are looking at.

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

  • How To use JVM (not CreateJavaVM)??

    Using JNI, I want to call the java class from C..
    Generally, I use "JNI_CreateJavaVM" method to create JavaVM's instance.
    when it continually call C execution file,
    it use much memory owing to creation of much JavaVM's Instances.
    1. I want to know how to use before create instance
    without creats another instance using "JNI_CreateJavaVM"
    2. I want to know how to use JavaVM that only create one it's instance.
    Any examples would be appreciated.
    Thank you very much.

    Hi,
    try to create one C thread for every Java application that you have to start. See http://java.sun.com/docs/books/tutorial/native1.1/invoking/invo.html file attach.c
    I.E. (hp-ux):
    pthread_create()...
    jvm->AttachCurrentThread((void **)&env,NULL);
    jobjectArray joa = env->NewObjectArray(argc, env->FindClass("java/lang/String"), NULL); // Parameters....
    jclass cls=env->FindClass("your class");
    jmethodID mid=env->GetStaticMethodID(cls, "main", "([Ljava/lang/String;)V");
    [env->RegisterNatives(cls,pmethParGui,1);] JNI CALL
    env->CallStaticVoidMethod(cls, mid, joa);
    jvm->DetachCurrentThread();
    pthread_exit...
    If your Java application use static memory, your memory will be shared.

  • Debugging C++ Programm using JNI

    Hi all,
    I'm trying to debug a program using JNI_CreateJavaVM with gdb on Linux (JDK 1.4). If I simply run the program it works and the VM ist loaded. If I start the program inside the debugger it fails at the Create call with several messages saying
    'Delayed SIGSTOP caught for LWP xxx'
    where xxx is the number of the thread. The final message is:
    Error occured during initialization of VM
    java.lang.IllegalArgumentException: Illegal Load: NaN
    and then its gone. I haven't found a way around this til now, does somebody know if debugging a native program using JNI is possible at all?
    Thanks,
    J-P

    I know it's possible, because I do it fairly often, just not with gdb. Sorry, but I can't help you there.
    God bless,
    -Toby Reyelts

  • JVM Crashing in ParallelGC at AIX

    We use JNI_CreateJavaVM to start an JVM from C. And in this JVM we use "LocateRegistry.createRegistry(JMXPORT);" to create registry. But the JVM always crash at Solaris with JDK1.6 ( It works fine with JDK1.5). The crash happens at the process of ParallelGC. It works fine with SerialGC.
    I can work around the crashing by add -XX:+UseSerialGC to change the GC method. But i need to know the root cause. It will be very appreciated for any help. Thanks.
    # A fatal error has been detected by the Java Runtime Environment:
    # SIGFPE (0x8) at pc=0xfffffd7ff0f2b898, pid=28894, tid=4
    # JRE version: 6.0_37-b06
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (20.12-b01 mixed mode solaris-amd64 compressed oops)
    # Problematic frame:
    # V [libjvm.so+0x46b898] JVM_GetCPClassNameUTF+0x94c8
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    --------------- T H R E A D ---------------
    Current thread (0x000000000081b800): VMThread [stack: 0xfffffd7ffe6af000,0xfffffd7ffe7af000] [id=4]
    siginfo:si_signo=SIGFPE: si_errno=0, si_code=4 (FPE_FLTOVF), si_addr=0xfffffd7ff0f2b898
    Registers:
    RAX=0x0000000000469f60, RBX=0x0000000000000000, RCX=0x0000000000461a60, RDX=0x0000000000880000
    RSP=0xfffffd7ffe7ae6a0, RBP=0xfffffd7ffe7ae6d0, RSI=0x0000000003300000, RDI=0x0000000000475500
    R8 =0x000000000046c860, R9 =0xfffffd7ffee52490, R10=0x0000000000461b00, R11=0x00000000f9380000
    R12=0x0000000000475500, R13=0xfffffd7ff1272fd0, R14=0x0000000000475d30, R15=0x00000000000cc010
    RIP=0xfffffd7ff0f2b898, RFLAGS=0x0000000000010246
    Top of Stack: (sp=0xfffffd7ffe7ae6a0)
    0xfffffd7ffe7ae6a0: fffffd7ff199af30 000000000046c2e0
    0xfffffd7ffe7ae6b0: 0000000000475500 0000000000000000
    0xfffffd7ffe7ae6c0: fffffd7ffe7ae6f0 408f4000447a0000
    0xfffffd7ffe7ae6d0: fffffd7ffe7ae710 fffffd7ff0f2b8e7
    0xfffffd7ffe7ae6e0: fffffd7ff199af30 000000000046c2e0
    0xfffffd7ffe7ae6f0: 00000000004623c0 fffffd7ff0f37d99
    0xfffffd7ffe7ae700: 00000000000cc010 fffffd7ff199af30
    0xfffffd7ffe7ae710: fffffd7ffe7ae720 fffffd7ff0f2b5da
    0xfffffd7ffe7ae720: fffffd7ffe7ae9c0 fffffd7ff1680c44
    0xfffffd7ffe7ae730: 0000000000461970 000000000046c2e0
    0xfffffd7ffe7ae740: fffffd7ff1999388 fffffd7ff19a16e8
    0xfffffd7ffe7ae750: 0000000000000000 000000000081cb70
    0xfffffd7ffe7ae760: 0000000000000000 000000001ecf66a6
    0xfffffd7ffe7ae770: 000000001f257d23 0000000000000000
    0xfffffd7ffe7ae780: 0000000000000000 0000000000000000
    0xfffffd7ffe7ae790: 0000000000000000 0000000000000000
    0xfffffd7ffe7ae7a0: fffffd7ffe7ae878 00000000004a6530
    0xfffffd7ffe7ae7b0: 0000000000000001 0000000000000000
    0xfffffd7ffe7ae7c0: fffffd7ffe7ae7d0 fffffd7ff0e6fc92
    0xfffffd7ffe7ae7d0: 0000000000517da0 00000000004a6520
    0xfffffd7ffe7ae7e0: 00000000004a6530 00000000004a6908
    0xfffffd7ffe7ae7f0: 000000000081b800 000000000047b280
    0xfffffd7ffe7ae800: 000000000081bf10 000000000081bf20
    0xfffffd7ffe7ae810: 000000000081c2f8 fffffd7ffe7aebb8
    0xfffffd7ffe7ae820: fffffd7ff1990100 0000000000000000
    0xfffffd7ffe7ae830: 0000000000000000 0000000000000000
    0xfffffd7ffe7ae840: 000000000045e450 fffffd7ff9c77300
    0xfffffd7ffe7ae850: fffffd7ffe010100 0000000000000000
    0xfffffd7ffe7ae860: fffffd7ffe7ae8a0 fffffd7ff0f7cf00
    0xfffffd7ffe7ae870: 00000000004a6530 000000000045e450
    0xfffffd7ffe7ae880: 0000000000000000 000000001ed00a99
    0xfffffd7ffe7ae890: 0000000000000001 0000000000476c80
    Instructions: (pc=0xfffffd7ff0f2b898)
    0xfffffd7ff0f2b878: 2c c0 4d 8b 4e 28 4d 89 01 4d 8b b4 24 08 01 00
    0xfffffd7ff0f2b888: 00 49 8b fc 33 c0 41 ff d5 4c 8b 80 98 00 00 00
    0xfffffd7ff0f2b898: f2 41 0f 5a 40 28 f3 0f 59 45 f8 f3 4c 0f 2c c0
    0xfffffd7ff0f2b8a8: 4d 8b 4e 28 4d 89 01 41 5e 41 5d 41 5c c9 c3 00
    Register to memory mapping:
    RAX=0x0000000000469f60 is an unknown value
    RBX=0x0000000000000000 is an unknown value
    RCX=0x0000000000461a60 is an unknown value
    RDX=0x0000000000880000 is an unknown value
    RSP=0xfffffd7ffe7ae6a0 is an unknown value
    RBP=0xfffffd7ffe7ae6d0 is an unknown value
    RSI=0x0000000003300000 is an unknown value
    RDI=0x0000000000475500 is an unknown value
    R8 =0x000000000046c860 is an unknown value
    R9 =0xfffffd7ffee52490 is an unknown value
    R10=0x0000000000461b00 is an unknown value
    R11=0x00000000f9380000 is an unknown value
    R12=0x0000000000475500 is an unknown value
    R13=0xfffffd7ff1272fd0: JVM_SupportsCX8+0x219000 in /****/bin/jdk1.6.0_37/jre/lib/amd64/server/libjvm.so at 0xfffffd7ff0ac0000
    R14=0x0000000000475d30 is an unknown value
    R15=0x00000000000cc010 is an unknown value
    Stack: [0xfffffd7ffe6af000,0xfffffd7ffe7af000], sp=0xfffffd7ffe7ae6a0, free space=1021k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    V [libjvm.so+0x46b898] JVM_GetCPClassNameUTF+0x94c8
    V [libjvm.so+0x46b8e7] JVM_GetCPClassNameUTF+0x9517
    V [libjvm.so+0x46b5da] JVM_GetCPClassNameUTF+0x920a
    V [libjvm.so+0xbc0c44] sysThreadAvailableStackWithSlack+0x3a384
    V [libjvm.so+0xbb3986] sysThreadAvailableStackWithSlack+0x2d0c6
    V [libjvm.so+0x531398] JVM_IsSameClassPackage+0x2eb8
    V [libjvm.so+0x472384] JVM_GetCPClassNameUTF+0xffb4
    V [libjvm.so+0x4725fa] JVM_GetCPClassNameUTF+0x1022a
    V [libjvm.so+0x5ad0a0] JVM_SupportsCX8+0x130d0
    V [libjvm.so+0x5ac55f] JVM_SupportsCX8+0x1258f
    V [libjvm.so+0xb7f469] JVM_RaiseSignal+0x1c8509
    C [libc.so.1+0x1149d4] thrpsetup+0xbc
    C [libc.so.1+0x114ca0] lwpstart+0x0
    VM_Operation (0xfffffd7ffd58b7a0): ParallelGCSystemGC, mode: safepoint, requested by thread 0x0000000000bba800
    --------------- P R O C E S S ---------------
    Java Threads: ( => current thread )
    0x0000000000c4d800 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=23, stack(0xfffffd7ffd0ff000,0xfffffd7ffd1ff000)]
    0x0000000000b7d000 JavaThread "RMI RenewClean-[10.182.73.206:34213]" daemon [_thread_blocked, id=22, stack(0xfffffd7ffd28a000,0xfffffd7ffd38a000)]
    0x0000000000ccd000 JavaThread "RMI TCP Connection(1)-10.182.73.206" daemon [_thread_in_native, id=21, stack(0xfffffd7ffd38b000,0xfffffd7ffd48b000)]
    0x0000000000bba800 JavaThread "GC Daemon" daemon [_thread_blocked, id=20, stack(0xfffffd7ffd48c000,0xfffffd7ffd58c000)]
    0x0000000000bb9000 JavaThread "RMI Reaper" [_thread_blocked, id=19, stack(0xfffffd7ffd58d000,0xfffffd7ffd68d000)]
    0x0000000000bb6800 JavaThread "RMI TCP Accept-0" daemon [_thread_blocked, id=18, stack(0xfffffd7ffd68e000,0xfffffd7ffd78e000)]
    0x0000000000bb5800 JavaThread "Timer-0" [_thread_blocked, id=17, stack(0xfffffd7ffd78f000,0xfffffd7ffd88f000)]
    0x0000000000c0e000 JavaThread "RMI TCP Accept-26999" daemon [_thread_in_native, id=14, stack(0xfffffd7ffd96f000,0xfffffd7ffda6f000)]
    0x000000000086b800 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=12, stack(0xfffffd7ffdea7000,0xfffffd7ffdfa7000)]
    0x0000000000868800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=11, stack(0xfffffd7ffdfa8000,0xfffffd7ffe0a8000)]
    0x0000000000865800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=10, stack(0xfffffd7ffe0a9000,0xfffffd7ffe1a9000)]
    0x000000000085a000 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=9, stack(0xfffffd7ffe1aa000,0xfffffd7ffe2aa000)]
    0x0000000000855000 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_in_native, id=8, stack(0xfffffd7ffe2ab000,0xfffffd7ffe3ab000)]
    0x0000000000849000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=7, stack(0xfffffd7ffe3ac000,0xfffffd7ffe4ac000)]
    0x0000000000823800 JavaThread "Finalizer" daemon [_thread_blocked, id=6, stack(0xfffffd7ffe4ad000,0xfffffd7ffe5ad000)]
    0x0000000000821800 JavaThread "Reference Handler" daemon [_thread_blocked, id=5, stack(0xfffffd7ffe5ae000,0xfffffd7ffe6ae000)]
    0x0000000000468800 JavaThread "main" [_thread_in_native, id=1, stack(0xfffffd7fff600000,0xfffffd7fffe00000)]
    Other Threads:
    =>0x000000000081b800 VMThread [stack: 0xfffffd7ffe6af000,0xfffffd7ffe7af000] [id=4]
    0x0000000000881000 WatcherThread [stack: 0xfffffd7ffdd3e000,0xfffffd7ffde3e000] [id=13]
    VM state:at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event])
    [0x0000000000467200] Threads_lock - owner thread: 0x000000000081b800
    [0x00000000004677a0] Heap_lock - owner thread: 0x0000000000bba800
    Heap
    PSYoungGen total 60928K, used 816K [0x00000000f5800000, 0x00000000f9c00000, 0x0000000100000000)
    eden space 52224K, 0% used [0x00000000f5800000,0x00000000f5800000,0x00000000f8b00000)
    from space 8704K, 9% used [0x00000000f8b00000,0x00000000f8bcc010,0x00000000f9380000)
    to space 8704K, 0% used [0x00000000f9380000,0x00000000f9380000,0x00000000f9c00000)
    PSOldGen total 137216K, used 0K [0x00000000e0a00000, 0x00000000e9000000, 0x00000000f5800000)
    object space 137216K, 0% used [0x00000000e0a00000,0x00000000e0a00000,0x00000000e9000000)
    PSPermGen total 22528K, used 9472K [0x00000000db800000, 0x00000000dce00000, 0x00000000e0a00000)
    object space 22528K, 42% used [0x00000000db800000,0x00000000dc1402f8,0x00000000dce00000)
    Code Cache [0xfffffd7ff9c00000, 0xfffffd7ffa000000, 0xfffffd7ffcc00000)
    total_blobs=280 nmethods=35 adapters=207 free_code_cache=49827264 largest_free_block=15680
    Dynamic libraries:
    0x0000000000400000 /****/bin/tlisten
    0xfffffd7fe8fc0000 /****/lib/libgpnet.so.71
    0xfffffd7fe8df0000 /****/lib/libtux.so.71
    0xfffffd7feae10000 /****/lib/libbuft.so.71
    0xfffffd7fe8db0000 /****/lib/libfml.so.71
    0xfffffd7fe8d70000 /****/lib/libfml32.so.71
    0xfffffd7fe9060000 /****/lib/libengine.so.71
    0xfffffd7ffe8cd000 /lib/64/libpthread.so.1
    0xfffffd7ffe8cb000 /lib/64/librt.so.1
    0xfffffd7ffe880000 /lib/64/libsocket.so.1
    0xfffffd7ffe7d0000 /lib/64/libnsl.so.1
    0xfffffd7ffeeb0000 /lib/64/libm.so.2
    0xfffffd7ffdcfc000 /lib/64/libthread.so.1
    0xfffffd7fff110000 /lib/64/libc.so.1
    0xfffffd7feadf0000 /****/lib/libutrace.so.71
    0xfffffd7feadb0000 /****/lib/libgiconv.so.71
    0xfffffd7ffd200000 /usr/lib/64/libCrun.so.1
    0xfffffd7fe8000000 /****/lib/libtmjmx.so
    0xfffffd7ffe8b0000 /lib/64/libmd.so.1
    0xfffffd7ffe7b0000 /lib/64/libmp.so.2
    0xfffffd7ff0ac0000 /****/bin/jdk1.6.0_37/jre/lib/amd64/server/libjvm.so
    0xfffffd7ffde3f000 /usr/lib/64/libsched.so.1
    0xfffffd7ffdcfb000 /lib/64/libdl.so.1
    0xfffffd7ffcdb0000 /lib/64/libm.so.1
    0xfffffd7ffceaf000 /lib/64/libdoor.so.1
    0xfffffd7ffcd70000 /usr/lib/64/libdemangle.so.1
    0xfffffd7fe9000000 /****/lib/registry.so
    0xfffffd7ff0a90000 /****/bin/jdk1.6.0_37/jre/lib/amd64/libverify.so
    0xfffffd7ff0a40000 /****/bin/jdk1.6.0_37/jre/lib/amd64/libjava.so
    0xfffffd7ff0950000 /****/bin/jdk1.6.0_37/jre/lib/amd64/libjdwp.so
    0xfffffd7ff0930000 /****/bin/jdk1.6.0_37/jre/lib/amd64/libnpt.so
    0xfffffd7ff0910000 /usr/lib/iconv/amd64/UTF-8%646.so
    0xfffffd7ff08f0000 /usr/lib/iconv/amd64/646%UTF-8.so
    0xfffffd7ff0a10000 /****/bin/jdk1.6.0_37/jre/lib/amd64/libzip.so
    0xfffffd7ff08d0000 /****/bin/jdk1.6.0_37/jre/lib/amd64/libdt_socket.so
    0xfffffd7fe6bc0000 /****/lib/libtuxjni.so
    0xfffffd7fe8ca0000 /****/lib/libtmib.so.71
    0xfffffd7fe8c10000 /****/lib/libqm.so.71
    0xfffffd7ff09f0000 /****/bin/jdk1.6.0_37/jre/lib/amd64/libj2pkcs11.so
    0xfffffd7ffde60000 /usr/lib/amd64/libpkcs11.so
    0xfffffd7ffdd10000 /lib/64/libcryptoutil.so.1
    0xfffffd7ffdbf0000 /usr/lib/security/64/pkcs11_softtoken.so
    0xfffffd7ffdbb0000 /usr/lib/64/libsoftcrypto.so.1
    0xfffffd7ffdb80000 /lib/64/libgen.so.1
    0xfffffd7ff09c0000 /****/bin/jdk1.6.0_37/jre/lib/amd64/libnet.so
    0xfffffd7fef430000 /****/bin/jdk1.6.0_37/jre/lib/amd64/librmi.so
    VM Arguments:
    jvm_args: -Djava.compiler=NONE -Dmyapp.jmx.auth=tux -Djava.security.policy= -Dmyapp.jmx.accessfile=/****/jmx/jmxaccess.properties -Dmyapp.jmx.addr=rmi://****:26999 -Xms200m -Xmx500m -Dmyapp.tlisten.nlsaddr=//****:27789 -XX:+HeapDumpOnCtrlBreak -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
    java_command: <unknown>
    Launcher Type: generic
    Environment Variables:
    JAVA_HOME=/****/bin/jdk1.6.0_37/jre
    PATH=/****/bin:/****/bin/jdk1.6.0_37/jre/bin/amd64:/****/bin:/****/bin/jdk1.6.0_37/jre/bin/amd64:/****/bin:/****/bin/jdk1.6.0_37/jre/bin/amd64:/****/bin:/****/bin/jdk1.6.0_37/jre/bin/amd64:/****/bin:/****/bin/jdk1.6.0_37/jre/bin/amd64:/****/bin:/****/bin/jdk1.6.0_37/jre/bin/amd64:/****/bin:/****/bin/jdk1.6.0_37/jre/bin/amd64:/****/bin/jdk1.6.0_37/bin/amd64/:/****/bin:/****/bin/jdk1.6.0_37/jre/bin/amd64:/****/bin:/****/bin/jdk1.6.0_37/jre/bin/amd64:/****/bin:/****/bin/jdk1.6.0_37/jre/bin/amd64:/****/bin:/****/bin/jdk1.6.0_37/jre/bin/amd64:/****/bin:/****/bin/jdk1.6.0_37/jre/bin/amd64:/****/bin:/****/bin/jdk1.6.0_37/jre/bin/amd64:/****/bin:/****/bin/jdk1.5.0_22/jre/bin:/****/bin:/****/bin/jdk1.6.0_37/jre/bin/amd64:/****/bin:/****/bin/jdk1.6.0_37/jre/bin/amd64:/****/bin:/****/bin/jdk1.6.0_37/jre/bin/amd64:/****/bin:/****/bin/jdk1.6.0_37/jre/bin:/****/bin:/****/bin/jdk1.6.0_37/jre/bin:/****/bin:/****/bin/jdk1.6.0_37/jre/bin:/usr/bin:/bin
    SHELL=/bin/ksh
    Signal Handlers:
    SIGSEGV: [libjvm.so+0xccfbb0], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
    SIGBUS: [libjvm.so+0xccfbb0], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
    SIGFPE: [libjvm.so+0x43f880], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
    SIGPIPE: [libjvm.so+0x43f880], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
    SIGXFSZ: [libjvm.so+0x43f880], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
    SIGILL: [libjvm.so+0x43f880], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
    SIGUSR1: SIG_IGN, sa_mask[0]=0x00000000, sa_flags=0x00000000
    SIGUSR2: SIG_IGN, sa_mask[0]=0x00000000, sa_flags=0x00000000
    SIGQUIT: [libjvm.so+0xb81a00], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
    SIGHUP: SIG_IGN, sa_mask[0]=0x00000000, sa_flags=0x00000000
    SIGINT: SIG_IGN, sa_mask[0]=0x00000000, sa_flags=0x00000000
    SIGTERM: [libjvm.so+0xb81a00], sa_mask[0]=0xffbffeff, sa_flags=0x00000004
    SIG39: [libjvm.so+0xb84870], sa_mask[0]=0x00000000, sa_flags=0x00000008
    SIG40: [libjvm.so+0x43f880], sa_mask[0]=0xffbffeff, sa_flags=0x0000000c
    --------------- S Y S T E M ---------------
    OS: Oracle Solaris 11 Express snv_151a X86
    Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
    Assembled 04 November 2010
    uname:SunOS 5.11 snv_151a i86pc (T2 libthread)
    rlimit: STACK 10240k, CORE infinity, NOFILE 65536, AS infinity
    load average:1.16 1.15 0.84
    CPU:total 2 (32 cores per cpu, 2 threads per core) family 6 model 44 stepping 2, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, ht
    Memory: 4k page, physical 8191612k(1152580k free)
    vm_info: Java HotSpot(TM) 64-Bit Server VM (20.12-b01) for solaris-amd64 JRE (1.6.0_37-b06), built on Sep 24 2012 11:42:33 by "" with Workshop 5.8
    time: Fri Oct 26 09:29:22 2012
    elapsed time: 0 seconds
    And following is the core dump stack trace
    Reading librmi.so
    t@4 (l@4) terminated by signal ABRT (Abort)
    0xfffffd7fff22dd1a: lwpkill+0x000a: jae lwpkill+0x18 [ 0xfffffd7fff22dd28, .+0xe ]
    (dbx) where
    current thread: t@4
    =>[1] lwpkill(0x4, 0x6, 0xffffff02cd0cbc00, 0xfffffd7fff22e54b, 0x0, 0xfffffd7ffe7addc0), at 0xfffffd7fff22dd1a
    [2] thr_kill(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7fff2224dd
    [3] raise(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7fff1ce9f1
    [4] abort(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7fff1a41a1
    [5] os::abort(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ff16403e4
    [6] VMError::report_and_die(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ff178f66a
    [7] JVM_handle_solaris_signal(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ff0eff703
    [8] signalHandler(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ff0eff88e
    [9] __sighndlr(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7fff224d66
    [10] call_user_handler(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7fff217a1c
    [11] sigacthandler(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7fff217c43
    ---- called from signal handler with signal 8 (SIGFPE) ------
    [12] GCAdaptivePolicyCounters::update_counters_from_policy(0x475500, 0x3300000, 0x880000, 0x461a60, 0x46c860, 0xfffffd7ffee52490), at 0xfffffd7ff0f2b898
    [13] PSGCAdaptivePolicyCounters::update_counters_from_policy(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ff0f2b8e7
    [14] PSGCAdaptivePolicyCounters::update_counters(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ff0f2b5da
    [15] PSScavenge::invoke_no_policy(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ff1680c44
    [16] PSMarkSweep::invoke(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ff1673986
    [17] VM_ParallelGCSystemGC::doit(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ff0ff1398
    [18] VM_Operation::evaluate(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ff0f32384
    [19] VMThread::evaluate_operation(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ff0f325fa
    [20] VMThread::loop(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ff106d0a0
    [21] VMThread::run(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ff106c55f
    [22] java_start(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7ff163f469
    [23] thrpsetup(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7fff2249d4
    [24] lwpstart(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7fff224ca0
    Edited by: geting on Oct 29, 2012 8:16 PM
    Edited by: geting on Oct 29, 2012 8:17 PM
    Edited by: geting on Dec 17, 2012 2:30 PM
    Edited by: geting on Dec 17, 2012 3:57 PM

    Thanks for your reply.
    My native code is based on C.
    We use Sun Studio C Compiler. Also all the warning is fixed.
    And i remove the JNI operations which is wrote by me from JAVA code. But the core dump is still happen at the same place.
    Now, here is the case. One Java program is invoked by C using "JNI_CreateJavaVM". In the Java program a RMI server is created.
    Following is all the JNI operation printed by -verbose:jni. I really need your help.
    [Dynamic-linking native method java.lang.Object.registerNatives ... JNI]
    [Registering JNI native method java.lang.Object.hashCode]
    [Registering JNI native method java.lang.Object.wait]
    [Registering JNI native method java.lang.Object.notify]
    [Registering JNI native method java.lang.Object.notifyAll]
    [Registering JNI native method java.lang.Object.clone]
    [Dynamic-linking native method java.lang.System.registerNatives ... JNI]
    [Registering JNI native method java.lang.System.currentTimeMillis]
    [Registering JNI native method java.lang.System.nanoTime]
    [Registering JNI native method java.lang.System.arraycopy]
    [Dynamic-linking native method java.lang.Thread.registerNatives ... JNI]
    [Registering JNI native method java.lang.Thread.start0]
    [Registering JNI native method java.lang.Thread.stop0]
    [Registering JNI native method java.lang.Thread.isAlive]
    [Registering JNI native method java.lang.Thread.suspend0]
    [Registering JNI native method java.lang.Thread.resume0]
    [Registering JNI native method java.lang.Thread.setPriority0]
    [Registering JNI native method java.lang.Thread.yield]
    [Registering JNI native method java.lang.Thread.sleep]
    [Registering JNI native method java.lang.Thread.currentThread]
    [Registering JNI native method java.lang.Thread.countStackFrames]
    [Registering JNI native method java.lang.Thread.interrupt0]
    [Registering JNI native method java.lang.Thread.isInterrupted]
    [Registering JNI native method java.lang.Thread.holdsLock]
    [Registering JNI native method java.lang.Thread.getThreads]
    [Registering JNI native method java.lang.Thread.dumpThreads]
    [Dynamic-linking native method java.lang.Class.registerNatives ... JNI]
    [Registering JNI native method java.lang.Class.getName0]
    [Registering JNI native method java.lang.Class.getSuperclass]
    [Registering JNI native method java.lang.Class.getInterfaces]
    [Registering JNI native method java.lang.Class.getClassLoader0]
    [Registering JNI native method java.lang.Class.isInterface]
    [Registering JNI native method java.lang.Class.getSigners]
    [Registering JNI native method java.lang.Class.setSigners]
    [Registering JNI native method java.lang.Class.isArray]
    [Registering JNI native method java.lang.Class.isPrimitive]
    [Registering JNI native method java.lang.Class.getComponentType]
    [Registering JNI native method java.lang.Class.getModifiers]
    [Registering JNI native method java.lang.Class.getDeclaredFields0]
    [Registering JNI native method java.lang.Class.getDeclaredMethods0]
    [Registering JNI native method java.lang.Class.getDeclaredConstructors0]
    [Registering JNI native method java.lang.Class.getProtectionDomain0]
    [Registering JNI native method java.lang.Class.setProtectionDomain0]
    [Registering JNI native method java.lang.Class.getDeclaredClasses0]
    [Registering JNI native method java.lang.Class.getDeclaringClass]
    [Registering JNI native method java.lang.Class.getGenericSignature]
    [Registering JNI native method java.lang.Class.getRawAnnotations]
    [Registering JNI native method java.lang.Class.getConstantPool]
    [Registering JNI native method java.lang.Class.desiredAssertionStatus0]
    [Registering JNI native method java.lang.Class.getEnclosingMethod0]
    [Dynamic-linking native method java.lang.Class.getPrimitiveClass ... JNI]
    [Dynamic-linking native method java.security.AccessController.getStackAccessControlContext ... JNI]
    [Dynamic-linking native method sun.misc.Unsafe.registerNatives ... JNI]
    [Registering JNI native method sun.misc.Unsafe.getLoadAverage]
    [Dynamic-linking native method java.lang.Throwable.fillInStackTrace ... JNI]
    [Registering JNI native method sun.misc.Unsafe.copyMemory]
    [Registering JNI native method sun.misc.Unsafe.setMemory]
    [Registering JNI native method sun.misc.Unsafe.getObject]
    [Registering JNI native method sun.misc.Unsafe.putObject]
    [Registering JNI native method sun.misc.Unsafe.getObjectVolatile]
    [Registering JNI native method sun.misc.Unsafe.putObjectVolatile]
    [Registering JNI native method sun.misc.Unsafe.getBoolean]
    [Registering JNI native method sun.misc.Unsafe.putBoolean]
    [Registering JNI native method sun.misc.Unsafe.getBooleanVolatile]
    [Registering JNI native method sun.misc.Unsafe.putBooleanVolatile]
    [Registering JNI native method sun.misc.Unsafe.getByte]
    [Registering JNI native method sun.misc.Unsafe.putByte]
    [Registering JNI native method sun.misc.Unsafe.getByteVolatile]
    [Registering JNI native method sun.misc.Unsafe.putByteVolatile]
    [Registering JNI native method sun.misc.Unsafe.getShort]
    [Registering JNI native method sun.misc.Unsafe.putShort]
    [Registering JNI native method sun.misc.Unsafe.getShortVolatile]
    [Registering JNI native method sun.misc.Unsafe.putShortVolatile]
    [Registering JNI native method sun.misc.Unsafe.getChar]
    [Registering JNI native method sun.misc.Unsafe.putChar]
    [Registering JNI native method sun.misc.Unsafe.getCharVolatile]
    [Registering JNI native method sun.misc.Unsafe.putCharVolatile]
    [Registering JNI native method sun.misc.Unsafe.getInt]
    [Registering JNI native method sun.misc.Unsafe.putInt]
    [Registering JNI native method sun.misc.Unsafe.getIntVolatile]
    [Registering JNI native method sun.misc.Unsafe.putIntVolatile]
    [Registering JNI native method sun.misc.Unsafe.getLong]
    [Registering JNI native method sun.misc.Unsafe.putLong]
    [Registering JNI native method sun.misc.Unsafe.getLongVolatile]
    [Registering JNI native method sun.misc.Unsafe.putLongVolatile]
    [Registering JNI native method sun.misc.Unsafe.getFloat]
    [Registering JNI native method sun.misc.Unsafe.putFloat]
    [Registering JNI native method sun.misc.Unsafe.getFloatVolatile]
    [Registering JNI native method sun.misc.Unsafe.putFloatVolatile]
    [Registering JNI native method sun.misc.Unsafe.getDouble]
    [Registering JNI native method sun.misc.Unsafe.putDouble]
    [Registering JNI native method sun.misc.Unsafe.getDoubleVolatile]
    [Registering JNI native method sun.misc.Unsafe.putDoubleVolatile]
    [Registering JNI native method sun.misc.Unsafe.getByte]
    [Registering JNI native method sun.misc.Unsafe.putByte]
    [Registering JNI native method sun.misc.Unsafe.getShort]
    [Registering JNI native method sun.misc.Unsafe.putShort]
    [Registering JNI native method sun.misc.Unsafe.getChar]
    [Registering JNI native method sun.misc.Unsafe.putChar]
    [Registering JNI native method sun.misc.Unsafe.getInt]
    [Registering JNI native method sun.misc.Unsafe.putInt]
    [Registering JNI native method sun.misc.Unsafe.getLong]
    [Registering JNI native method sun.misc.Unsafe.putLong]
    [Registering JNI native method sun.misc.Unsafe.getFloat]
    [Registering JNI native method sun.misc.Unsafe.putFloat]
    [Registering JNI native method sun.misc.Unsafe.getDouble]
    [Registering JNI native method sun.misc.Unsafe.putDouble]
    [Registering JNI native method sun.misc.Unsafe.getAddress]
    [Registering JNI native method sun.misc.Unsafe.putAddress]
    [Registering JNI native method sun.misc.Unsafe.allocateMemory]
    [Registering JNI native method sun.misc.Unsafe.reallocateMemory]
    [Registering JNI native method sun.misc.Unsafe.freeMemory]
    [Registering JNI native method sun.misc.Unsafe.objectFieldOffset]
    [Registering JNI native method sun.misc.Unsafe.staticFieldOffset]
    [Registering JNI native method sun.misc.Unsafe.staticFieldBase]
    [Registering JNI native method sun.misc.Unsafe.ensureClassInitialized]
    [Registering JNI native method sun.misc.Unsafe.arrayBaseOffset]
    [Registering JNI native method sun.misc.Unsafe.arrayIndexScale]
    [Registering JNI native method sun.misc.Unsafe.addressSize]
    [Registering JNI native method sun.misc.Unsafe.pageSize]
    [Registering JNI native method sun.misc.Unsafe.defineClass]
    [Registering JNI native method sun.misc.Unsafe.defineClass]
    [Registering JNI native method sun.misc.Unsafe.allocateInstance]
    [Registering JNI native method sun.misc.Unsafe.monitorEnter]
    [Registering JNI native method sun.misc.Unsafe.monitorExit]
    [Registering JNI native method sun.misc.Unsafe.tryMonitorEnter]
    [Registering JNI native method sun.misc.Unsafe.throwException]
    [Registering JNI native method sun.misc.Unsafe.compareAndSwapObject]
    [Registering JNI native method sun.misc.Unsafe.compareAndSwapInt]
    [Registering JNI native method sun.misc.Unsafe.compareAndSwapLong]
    [Registering JNI native method sun.misc.Unsafe.putOrderedObject]
    [Registering JNI native method sun.misc.Unsafe.putOrderedInt]
    [Registering JNI native method sun.misc.Unsafe.putOrderedLong]
    [Registering JNI native method sun.misc.Unsafe.park]
    [Registering JNI native method sun.misc.Unsafe.unpark]
    [Dynamic-linking native method sun.reflect.Reflection.getCallerClass ... JNI]
    [Dynamic-linking native method java.security.AccessController.getInheritedAccessControlContext ... JNI]
    [Dynamic-linking native method java.lang.ClassLoader.registerNatives ... JNI]
    [Registering JNI native method java.lang.ClassLoader.retrieveDirectives]
    [Dynamic-linking native method java.security.AccessController.doPrivileged ... JNI]
    [Dynamic-linking native method java.lang.System.initProperties ... JNI]
    [Dynamic-linking native method sun.misc.VM.initialize ... JNI]
    [Dynamic-linking native method java.io.FileSystem.getFileSystem ... JNI]
    [Dynamic-linking native method java.io.UnixFileSystem.initIDs ... JNI]
    [Dynamic-linking native method java.lang.Float.floatToRawIntBits ... JNI]
    [Dynamic-linking native method java.lang.Double.doubleToRawLongBits ... JNI]
    [Dynamic-linking native method java.lang.String.intern ... JNI]
    [Dynamic-linking native method java.io.UnixFileSystem.getBooleanAttributes0 ... JNI]
    [Dynamic-linking native method java.lang.System.mapLibraryName ... JNI]
    [Dynamic-linking native method java.io.UnixFileSystem.canonicalize0 ... JNI]
    [Dynamic-linking native method java.lang.ClassLoader$NativeLibrary.load ... JNI]
    [Dynamic-linking native method java.io.FileInputStream.initIDs ... JNI]
    [Dynamic-linking native method java.io.FileDescriptor.initIDs ... JNI]
    [Dynamic-linking native method java.io.FileOutputStream.initIDs ... JNI]
    [Dynamic-linking native method java.lang.System.setIn0 ... JNI]
    [Dynamic-linking native method java.lang.Runtime.maxMemory ... JNI]
    [Dynamic-linking native method java.lang.System.setOut0 ... JNI]
    [Dynamic-linking native method java.lang.System.setErr0 ... JNI]
    [Dynamic-linking native method sun.misc.Signal.findSignal ... JNI]
    [Dynamic-linking native method sun.misc.Signal.handle0 ... JNI]
    [Dynamic-linking native method java.lang.Compiler.registerNatives ... JNI]
    [Registering JNI native method java.lang.Compiler.compileClass]
    [Registering JNI native method java.lang.Compiler.compileClasses]
    [Registering JNI native method java.lang.Compiler.command]
    [Registering JNI native method java.lang.Compiler.enable]
    [Registering JNI native method java.lang.Compiler.disable]
    [Dynamic-linking native method java.lang.ClassLoader$NativeLibrary.find ... JNI]
    [Dynamic-linking native method java.security.AccessController.doPrivileged ... JNI]
    [Dynamic-linking native method java.io.FileInputStream.open ... JNI]
    [Dynamic-linking native method java.io.FileInputStream.readBytes ... JNI]
    [Dynamic-linking native method java.io.FileInputStream.available ... JNI]
    [Dynamic-linking native method java.lang.Object.getClass ... JNI]
    [Dynamic-linking native method java.lang.reflect.Array.newArray ... JNI]
    [Dynamic-linking native method java.io.FileInputStream.close0 ... JNI]
    [Dynamic-linking native method java.io.UnixFileSystem.list ... JNI]
    [Dynamic-linking native method java.io.ObjectStreamClass.initNative ... JNI]
    [Dynamic-linking native method java.lang.Class.forName0 ... JNI]
    [Dynamic-linking native method sun.reflect.Reflection.getClassAccessFlags ... JNI]
    [Dynamic-linking native method sun.reflect.NativeConstructorAccessorImpl.newInstance0 ... JNI]
    [Dynamic-linking native method java.lang.ClassLoader.findLoadedClass0 ... JNI]
    [Dynamic-linking native method java.lang.ClassLoader.findBootstrapClass ... JNI]
    [Dynamic-linking native method sun.misc.VMSupport.initAgentProperties ... JNI]
    Listening for transport dt_socket at address: 8000
    [Dynamic-linking native method java.security.AccessController.doPrivileged ... JNI]
    [Dynamic-linking native method java.util.zip.ZipFile.initIDs ... JNI]
    [Dynamic-linking native method java.io.UnixFileSystem.getLastModifiedTime ... JNI]
    [Dynamic-linking native method java.util.zip.ZipFile.open ... JNI]
    [Dynamic-linking native method java.util.zip.ZipFile.getTotal ... JNI]
    [Dynamic-linking native method java.util.zip.ZipFile.getEntry ... JNI]
    [Dynamic-linking native method java.util.zip.ZipEntry.initIDs ... JNI]
    [Dynamic-linking native method java.util.zip.ZipEntry.initFields ... JNI]
    [Dynamic-linking native method java.util.zip.ZipFile.freeEntry ... JNI]
    [Dynamic-linking native method java.util.zip.ZipFile.getCSize ... JNI]
    [Dynamic-linking native method java.util.zip.ZipFile.getSize ... JNI]
    [Dynamic-linking native method java.util.zip.ZipFile.getMethod ... JNI]
    [Dynamic-linking native method java.util.zip.Inflater.initIDs ... JNI]
    [Dynamic-linking native method java.util.zip.Inflater.init ... JNI]
    [Dynamic-linking native method java.util.zip.Inflater.inflateBytes ... JNI]
    [Dynamic-linking native method java.util.zip.ZipFile.read ... JNI]
    [Dynamic-linking native method java.util.zip.Inflater.reset ... JNI]
    [Dynamic-linking native method java.lang.Package.getSystemPackage0 ... JNI]
    [Dynamic-linking native method java.util.jar.JarFile.getMetaInfEntryNames ... JNI]
    [Dynamic-linking native method java.lang.ClassLoader.defineClass1 ... JNI]
    [Dynamic-linking native method java.lang.ProcessEnvironment.environ ... JNI]
    [Dynamic-linking native method java.security.AccessController.doPrivileged ... JNI]
    [Dynamic-linking native method java.util.ResourceBundle.getClassContext ... JNI]
    [Dynamic-linking native method java.lang.Class.isAssignableFrom ... JNI]
    [Dynamic-linking native method java.lang.System.identityHashCode ... JNI]
    [Dynamic-linking native method java.util.concurrent.atomic.AtomicLong.VMSupportsCS8 ... JNI]
    [Dynamic-linking native method java.lang.Double.longBitsToDouble ... JNI]
    [Dynamic-linking native method sun.security.pkcs11.wrapper.PKCS11.initializeLibrary ... JNI]
    [Dynamic-linking native method sun.security.pkcs11.wrapper.PKCS11.connect ... JNI]
    [Dynamic-linking native method sun.security.pkcs11.wrapper.PKCS11.C_Initialize ... JNI]
    [Dynamic-linking native method sun.security.pkcs11.wrapper.PKCS11.C_GetInfo ... JNI]
    [Dynamic-linking native method sun.security.pkcs11.wrapper.PKCS11.C_GetSlotList ... JNI]
    [Dynamic-linking native method sun.security.pkcs11.wrapper.PKCS11.C_GetSlotInfo ... JNI]
    [Dynamic-linking native method sun.security.pkcs11.wrapper.PKCS11.C_GetTokenInfo ... JNI]
    [Dynamic-linking native method sun.security.pkcs11.wrapper.PKCS11.C_OpenSession ... JNI]
    [Dynamic-linking native method sun.security.pkcs11.wrapper.PKCS11.C_GetMechanismList ... JNI]
    [Dynamic-linking native method sun.security.pkcs11.wrapper.PKCS11.C_GenerateRandom ... JNI]
    [Dynamic-linking native method java.net.InetAddress.init ... JNI]
    [Dynamic-linking native method java.net.InetAddressImplFactory.isIPv6Supported ... JNI]
    [Dynamic-linking native method java.net.Inet6AddressImpl.getLocalHostName ... JNI]
    [Dynamic-linking native method java.net.Inet6AddressImpl.lookupAllHostAddr ... JNI]
    [Dynamic-linking native method java.net.Inet4Address.init ... JNI]
    [Dynamic-linking native method java.net.Inet6Address.init ... JNI]
    [Dynamic-linking native method java.lang.Runtime.availableProcessors ... JNI]
    [Dynamic-linking native method java.net.PlainSocketImpl.initProto ... JNI]
    [Dynamic-linking native method java.net.PlainSocketImpl.socketCreate ... JNI]
    [Dynamic-linking native method java.net.PlainSocketImpl.socketBind ... JNI]
    [Dynamic-linking native method java.net.PlainSocketImpl.socketListen ... JNI]
    [Dynamic-linking native method java.net.PlainSocketImpl.socketAccept ... JNI]
    [Dynamic-linking native method sun.reflect.ConstantPool.getUTF8At0 ... JNI]
    [Dynamic-linking native method sun.reflect.NativeMethodAccessorImpl.invoke0 ... JNI]
    [Dynamic-linking native method java.lang.reflect.Proxy.defineClass0 ... JNI]
    [Dynamic-linking native method java.lang.UNIXProcess.initIDs ... JNI]
    [Dynamic-linking native method java.lang.UNIXProcess.forkAndExec ... JNI]
    [Dynamic-linking native method java.lang.UNIXProcess.waitForProcessExit ... JNI]
    [Dynamic-linking native method java.lang.UNIXProcess.destroyProcess ... JNI]
    [Dynamic-linking native method java.io.FileOutputStream.close0 ... JNI]
    [Dynamic-linking native method java.net.PlainSocketImpl.socketConnect ... JNI]
    [Dynamic-linking native method java.net.PlainSocketImpl.socketSetOption ... JNI]
    [Dynamic-linking native method java.net.SocketOutputStream.init ... JNI]
    [Dynamic-linking native method java.net.SocketOutputStream.socketWrite0 ... JNI]
    [Dynamic-linking native method java.net.SocketInputStream.init ... JNI]
    [Dynamic-linking native method java.net.SocketInputStream.socketRead0 ... JNI]
    [Dynamic-linking native method sun.misc.GC.maxObjectInspectionAge ... JNI]
    [Dynamic-linking native method java.lang.Runtime.gc ... JNI]
    # A fatal error has been detected by the Java Runtime Environment:
    # SIGFPE (0x8) at pc=0xfffffd7ffccbb898, pid=1912, tid=4
    # JRE version: 6.0_37-b06
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (20.12-b01 mixed mode solaris-amd64 compressed oops)
    # Problematic frame:
    # V [libjvm.so+0x46b898] JVM_GetCPClassNameUTF+0x94c8
    # An error report file with more information is saved as:
    # /testarea/gtt/test/jmx/servers/hs_err_pid1912.log
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    Edited by: geting on Oct 30, 2012 6:43 PM
    Edited by: geting on Oct 30, 2012 6:43 PM

  • DestroyJavaVM does not completely shut the VM

    Hi All,
    I'm using JDK 1.4.2. The platforms used are WindowsXP and MacOSX. In my Native Application after setting up the JVM using JNI_CreateJavaVM, i use the same to load some jar files using URLClassLoader. After all is done i need to shut the VM and then move these jar files to some location. I use DestroyJavaVM, but it does not seem to completely do its task. Some of the threads started by JNI_CreateJavaVM are still up and owing to this the jar files are held up by VM. Is anyone having any idea whether DestroyJavaVM is still faulty or do i need to do something else.
    Regards

    Sorry but DestroyJavaVM isn't guaranteed in the current Java SE implementation to completely terminate everything. For example you can't currently destroy the VM and create a new one in the same process.
    I would recommend you try to forcibly close the jar files you've opened before terminating the JVM. For example, you might drop all references to instances of classes defined by that URLClassLoader and perform a couple of full GCs to see if the URLClassLoader is collected and its jar files closed. Or you might subclass URLClassLoader and add a method to close down all of the jar files it has open.

  • Error in creating JVM, need help!

    I am just trying a simple c program to create a JVM on a linux machine. However it always result errors during compilation. I got no idea what's went wrong.
    I am using jdk1.2.
    #include <jni.h>
    #include <stdlib.h>
    int main( int argc, char *argv[] )
    JNIEnv *env;
    JavaVM *jvm;
    JDK1_1InitArgs vm_args;
    jint res;
    vm_args.version=0x00010001;
    JNI_GetDefaultJavaVMInitArgs(&vm_args);
    vm_args.classpath=".:/usr/local/jdk1.2.2/include/linux/jni_md.h:/usr/local/jdk1.2.2/include$
    JNI_GetDefaultJavaVMInitArgs(&vm_args);
    res=JNI_CreateJavaVM(&jvm,(void **)&env,&vm_args);
    if (res < 0)
    fprintf(stderr, "Can't create Java VM\n");
    exit(1);
    (*jvm)->DestroyJavaVM(jvm);
    return(0);
    Errors:
    /tmp/ccvMj208.o: In function `main':
    /home/bettylo/2/invoke.c:12: undefined reference to `JNI_GetDefaultJavaVMInitArgs'
    /home/bettylo/2/invoke.c:14: undefined reference to `JNI_GetDefaultJavaVMInitArgs'
    /home/bettylo/2/invoke.c:15: undefined reference to `JNI_CreateJavaVM'
    collect2: ld returned 1 exit status
    This is the command I use to compile the c program
    gcc -I$JAVA_HOME/include/linux -I$JAVA_HOME/include -o invoke.exe invoke.c

    You can set the LD_LIBRARY_PATH in linux with the follow command :
    Replace whatever specific library path you need in the below example!
    Red Hat Linux specific format :
    export LD_LIBRARY_PATH=<your lib path>:<other paths required>:$LD_LIBRARY_PATH
    Another small example :
    export LD_LIBRARY_PATH=/usr/java/jsdk1.2/jre/lib:$LD_LIBRARY_PATH
    Only after loading the library environment will you be able to run the JVM successfully.
    Your other question on the segmentation core dump is probably due to the fact that you use a (void**) pointer with the old 1.1 vm_args.version. JDK versions lower than 1.2 uses the older interface that is not as portable and takes a JNIEnv pointer in the
    JNI_CreateJavaVM(JavaVM* ,JNIEnv **,JDK1_1InitArgs);
    method but newer 1.2 uses
    JNI_CreateJavaVM(JavaVM* ,void **,JavaVMInitArgs);
    Read the updated docs on 1.2 from your JDK distribution and you will realize that the segmentation crush was due to pointer problems. Note also that the code to invoke the 1.2 version and 1.1 versions are different, so read the docs carefully.

  • CreateJavaVM fails with JNI_ENOMEM (-4) even though there is enogh memory

    Hi,
    I am creating a VM on Win XP using JNI_CreateJavaVM. It fails when I add an option "-Xmx1024M", error code being JNI_ENOMEM (-4). It works with "-Xmx500M". The system has 2GB memory, other java processes (non-JNI) start without problems even with more than "-Xmx1024M".
    Any ideas?
    Bye,
    Michael

    I have a similar, but I think much simpler problem. Namely, I get ENOMEM's when as far as I can tell there's plenty of memory available. It seems to have something to do with how Windows is configured, although I've never been able to determine what it could be.FWIW, in my case, I found that if I loaded my JNI dll into a console process, the max heap requested was always allocated. But when loading into Excel, the same amount would be too much. This was partly due to the fact that Excel has its own memory management, limiting the amount of memory workbooks can use. Also, it could be due to the vm not being able to reserve a contiguous chunk of memory for the max heap space.
    Why (and how) separate the permanent generation space from the rest of the max heap? It seems you'll fail if you can't get that much space (which is the why) but how did you determine what it is?The VM uses the perm gen space plus the requested max heap space when attempting the VirtualAlloc call to verify that it can allocate the specified amount. The default perm gen is 64MB, but that can be changed via the -XX:MaxPermSize vm parameter, so I allow for any requested value.
    What's CRUSH_JNI_VERSION? It's not in any .h file I have.That's just my own constant defined to be either JNI_VERSION_1_4 or JNI_VERSION_1_6.
    Why are you messing with the bootclasspath? (I suspect you're adding something to it. Generally the VM can find it's own damn classpath).Yep, I'm adding the 2.1 JAXB jar to the bootclasspath because earlier 1.6 distributions included JAXB 2.0 and I needed 2.1.
    -sarah

  • Repost : I really need those information

    Hi,
    Sorry for making more noise than I like to, but I really need to get answers to those questions, about JVM behavior in the JNI side.
    how to avoid JNI_CreateJavaVM to exit :
    http://forum.java.sun.com/thread.jsp?forum=52&thread=197180
    where I try know why this function makes my app exit (not crash, I mean call some exit() function). and how I can fix it
    JNI_CreateJavaVM in debug mode
    http://forum.java.sun.com/thread.jsp?forum=52&thread=197174
    where I am seeking a clean way to determine which dlls to load to have the remote debug mode working.
    CallNonvirtual and inheritance
    http://forum.java.sun.com/thread.jsp?forum=52&thread=194066
    Where I am wondering about real use case, pros & cons, of those CallNonVirtual.. functions.
    I need to know why...
    Is my english so much incorrect ?
    Isn't this the good place to talk JNI ?
    Am I doing such strange things nobody else experienced ?
    Am I the only one to use JNI_CreateJavaVM CallNonvirtual ...,
    Thanks for your help
    C.Dor�

    With regard to the required (by the jvm) dlls:
    I conclude that you tried to move the jvm, and now it can't find its required dlls.
    Or: You may have to set the current working directory before you load the jvm.

  • Call Java methods from vi

    I have exising software written in Java that I would like to make use of inside of a vi.  I have written a shared library in C++ that creates a Java JVM using JNI_CreateJavaVM and then calls a few methods from a specific class.  When i use this DLL from c++ application things work fine.  However when I try calling this dll from LabView JNI_CreateJavaVM fails with a -4 return code.  When looking around for help I often see http://digital.ni.com/public.nsf/allkb/BEE812007BA2A9B486256BC80068A49A?OpenDocument referenced and this has been the approach I have taken.  I have never come upon any sample code that shows this behavior working however.  If someone could point me to some sample code or suggest a reason why JNI_CreateJavaVM isn't working I would be very grateful.  Thanks.

    I ran into the same problem.  I am trying to call some code written in Java.  I am not a Java developer but a colleague has written a C DLL which I call from LabVIEW to invoke the JNI to execute the Java classes.  We ran into the exact same issue.  My colleague changed the amount of memory the virtual machine was requesting.  Here is a sample of the code from my colleague:
    JavaVMOption options[4];
      jint res;
      options[0].optionString = "-Djava.class.path=C:\\Shared\\C-JNI-Bridge-Prototype\\bin"; //Path to the java class files.
      options[2].optionString = "-Xmx16m";
      options[3].optionString = "-Xms16m";
      options[1].optionString = "-XX:+HeapDumpOnOutOfMemoryError=C:\\Shared\\C-JNI-Bridge-Prototype\\bin\\dumps";
      vm_args.version = JNI_VERSION_1_6; //JDK version. This indicates version 1.6
      vm_args.nOptions = 3;
      vm_args.options = options;
    I personally don't really understand this, but I believe this is using virtual machine options that are not the defaults.  The default options were probably requesting more memory than LabVIEW could allocate for the virtual machine.  Keep in mind that these limits will likely be different for your application.

  • Invoking JVM + GUI components from C/C++

    My C/C++ program does the following:
    1. Create JVM using : JNI_CreateJavaVM(...);
    2. Find the class using : jclass cls = env->FindClass(loadClass);
    3. find the method using : jmethodID mid = env->GetStaticMethodID(...);
    4. Invoke a method using : result = env->CallStaticIntMethod(...);
    Now all of this works and does mostly what I expect. The problem is that it never returns. The invoked java method creates a GUI containing various buttons. If the cancel button on the GUI does a System.exit(0), then the whole process, including my C/C++ program terminates. NOT what I want!. I assume that although the static method has terminated (create the GUI and make it visible), the GUI threads are still active. If I change the cancel button to call setVisible(false) and dispose(), the dialog disapperars, but the java method never return to the native code.
    So, what is the process I could use? Essentially, this code is attemptng to use Java as the device independent GUI for some exsting code.
    Thanks

    If the GUI is "disposed", then what is it you want the C code to do?
    If it is just cleanup, then an alternative would be to create a callback routine in C, and call it from java.

Maybe you are looking for

  • Itl from old windows to new mac, lacking permission or itl is locked

    I recently got a new macbook air and am in the process of moving my itunes library (about 70 gb) to my external hard drive so that i can access it without taking up space on my macbook's 128 gb hard drive. I followed these directions (http://ipod.abo

  • Acrobat 7.0 professional pdf binders issue

    I have adobe acrobat 7.0 professional and this feature stopped working:: to make a pdf of multiple files, like word docs. it does compined many esisting PDFs into one binder, not like it used to do to combine several mixed docments to a PDF binder. I

  • How to add the stl.jar file

    Hi, where should i put the jstl.jar file in order to use it with apache tomcat. thnx.

  • Cannot cut and paste

    In the mail program, I have recently been unable to click and drag emails from the inbox to other mailboxes and then after discovering that, I have been unable to copy and paste in Word 2004. I get an error message when using Word 2004 that says "Una

  • HT5312 How to I retrieve my security question answers

    How to retrieve my security question answers