Exit handling in native function by JNI

Hi everyone,
We are developing a Java application using native function calls through JNI in Linux.
The application starts and calls a native function and the native function attach a signal
handler and an exit handler. In addition, in the native function, we fork another process
and in the forked process, we calls a several java-side methods. It works in normal cases.
However, when System.exit() is called in the java-side methods invoked by a native function,
the application is stopped. Thus we add shutdown hook (Runtime.getRuntime().addShutdownHook())
to treat this case. The shutdown hook just calls a native method, and the native method
just calls exit(). We expect the calling exit() in the native method invoked in shutdown hook for JVM
invokes our exit handler which is attached in advance. It looks working well.
But, sometimes we find several garbage(?) jvm processes (we can see the process named as "java"
in using Linux command "ps"). The parent process of these processes is init process (pid = 1).
With the pid of these processes, we suspect the processes are created when we fork another process
in native function invoked through JNI. However it is not happened every times in our application.
Why the garbage java processes remain? Is there any problem in the calling exit() in the native
method invoked during JVM Shutdown process?
I hope any answers for this problem.
Thanks in advance,
Seung-Uk Oh

Thus we add shutdown hook
(Runtime.getRuntime().addShutdownHook())
to treat this case. The shutdown hook just calls a
native method, and the native method
just calls exit(). We expect the calling exit() in the
native method invoked in shutdown hook for JVM
invokes our exit handler which is attached in advance.
It looks working well.I wouldn't think that was a good idea.
You are terminating the JVMs normal exit process. Why don't you just register the exit processes in your own stack and call them with the native method?

Similar Messages

  • JVM exit handler -  for jvm invoked thro' native C

    complicated, atleast for me :) where do I find if JVM installs any exit handlers when invoked through native C app.
    OS -> HP UX 11
    java -version ->
    java version "1.4.0.02"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0.02-021031-18:00)
    Java HotSpot(TM) Server VM (build 1.4 1.4.0.02-021031-19:15-PA_RISC2.0 PA2.0, mixed mode)
    Although jvm used is HP's hotspot, behaviour seems to be generic, so any directions are appreciated.
    In my case JNI based native shared object (on ux) is being used as a pluggin for comm with microsoft SQL2k.
    A daemon loads the pluggin (shl_load) -> transaction -> unloads (shl_unload) pluggin.
    For each tran I need to create a new JVM instance and later distroy it as it is not possible to multiple times create and distroy JVM in same process space (as encountered)
    LD_PRELOAD=.../libjvm.sl
    start the daemon( basic signals masked)
    Parent -> fork() a child process and wait for its exit status.
    Child -> Load JVM and execute reqd method
    Child -> unload JVM
    Child -> exit() the child process
    Parent ->Check the child process exit() code and carry further processing.
    Sometimes child does not exit cleanly. Even after exit() child process can be seen in process table and parent wait()'s idefinetly for child exit code.
    gdb ouput of child preocess
    #0 0xdd28ca38 in os::report_fatal_error () from /opt/java1.4/jre/lib/PA_RISC2.0/server/libjvm.sl
    #1 0xdd28dc48 in os::handle_unexpected_exception ()
    from /opt/java1.4/jre/lib/PA_RISC2.0/server/libjvm.sl
    #2 0xdd296c50 in os::Hpux::JVM_handle_hpux_signal ()
    from /opt/java1.4/jre/lib/PA_RISC2.0/server/libjvm.sl
    #3 0xdd293adc in os::Hpux::signalHandler ()
    from /opt/java1.4/jre/lib/PA_RISC2.0/server/libjvm.sl
    #4 <signal handler called>
    #5 0x7e5e6134 in ?? ()
    #6 0xc03c6fbc in __niamHelper () from /usr/lib/libCsup.2
    Can any one tell me what exactly is happening ?
    If I call [b]_exit() instead of exit() everything works fine.

    Thnx a lot,
         Finally I was able to locate atexit()'ed function which was causing the problem (setting br at exit() was not working, execution straightway stopped at #0)
    (gdb) thr 1
    [Switching to thread 1 (system thread 17555)]
    (gdb) bt
    #0 0x7e6224e0 in epc_exit_handler () from /citisafe/users/yogiraj/cs35/dll/ora_tcp.sl
    #1 0xc03c6fbc in __niamHelper () from /usr/lib/libCsup.2
    #2 0xc03c7110 in niambody () from /usr/lib/libCsup.2
    #3 0xc03c721c in _niam () from /usr/lib/libCsup.2
    #4 0xc016fe20 in exit () from /usr/lib/libc.2
    #5 0xc4f0c364 in sql_exec_custStrProc () from /citisafe/users/yogiraj/cs35/lib/libtcsql.sl
    #6 0x7ec0c9f4 in exec_ext_mgmt (p_ExtCredentials=0x7edf2878)
    at /citisafe/users/yogiraj/cs35/c/sql_app.c:251
    #7 0x9620 in adm_process_rec ()
    #8 0x8bc8 in process_pwd_requests ()
    #9 0x8684 in adm_do_ext_sync ()
    #10 0x7f5c in main ()
    Oracle client lib was the culprit.     Daemon is basically a 'C' daemon which loads pluggins for communication with various DB's including Oracle, Sybase, MS SQL etc and later unloads them on completion.
    Ora lib libclntsh.sl installed "epc_exit_handler", eventhough we had shl_unload()'ed oracle pluggin earlier the handler refrence was still around. Later when process exit()'ed may be static dealloaction mech panicked.
    Above exit() handler execution even after unloading of Oracle libs seems to be a known bug and work around suggested is to LD_PRELOAD=%ORALIB/libclntsh.sl. After LD_PRELOAD'ing exit() works fine.

  • How to handle errno in native function?

    How to get the correct errno in a native function? I'm using Unix message queues in my native methods and I always get the errno = 0 (it should be ENOMSG = 35) returned when the desired message is not yet available (calling msgrcv with IPC_NOWAIT set). This program is running on IBM AIX 4.3. Please help...

    I cached and printed the errno in my C native function
    and it was 0?Well there are several possibilities.
    One it is zero. Which means that there is mis-match on your part as to why it should have a different value. If you print the value out in your C code right after you get it and it is zero then this is definitely the problem. The most likely reason is because the data that you pass is not what you think it is.
    Or you are not returning the cached value to java but rather something else. If you print the value out in your C code just after you get it, and it has the correct value then this is your problem. The mostly likely reason for this is that you are actually using two different variables (but you think it is one variable.) One possible reason for this is different way "static" is handled in C and C++. But there could be others.

  • Calling native functions from java w/out DLL

    If I invoke a JVM inside my c++ app and try to start up a class that calls a native function, do I still need a DLL for that? Or will it look to my header file and then look to my implementation somewhere in a c++ class?
    For example:
    WinMain() - Invokes JVM and loads "HelloWorld" java class, then calls its 'main' method.
    HelloWorld.java - 'main' method calls "displayHello();" a native function.
    HelloWorld.h - defines displayHello native interface
    So it looks simply to the cpp implementation of the interface...I tried executing this but it isnt working...is it even possible?

    OK, I attempted what you posted by writing the following code... please look at because I get a 'main' not found error. I am trying to execute this from a win32 app...
    Callbacks.java:
    class Callbacks {
      private native void nativeMethod(int depth);
      private void callback(int depth) {
        if (depth < 5) {
          System.out.println("In Java, depth = " + depth + ", about to enter C");
          nativeMethod(depth + 1);
          System.out.println("In Java, depth = " + depth + ", back from C");
        } else
          System.out.println("In Java, depth = " + depth + ", limit exceeded");
      public static void main(String args[]) {
        Callbacks c = new Callbacks();
        c.nativeMethod(0);
    }InvokeJVM.cpp:
    #include "InvokeJVM.h"
    //Log any windows errors
    void InvokeJVM::LogWin32Error(const char * pTitle){
         PCHAR pBuffer;   
         LONG  lError = GetLastError ( );
         FormatMessage ( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
              NULL,                   
              lError,                   
              MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),                   
              (char *)&pBuffer,                   
              0,                   
              NULL );
         //LogError ("Win32 error: %s %s\n",pBuffer,pTitle);
         LocalFree ( pBuffer );
    //Get a string returned from the windows registry
    bool InvokeJVM::GetStringFromRegistry(HKEY key, const char *name, unsigned char *buf, int bufsize){
         DWORD type, size;
         if (RegQueryValueEx(key, name, 0, &type, 0, &size) == 0 && type == REG_SZ && (size < (unsigned int)bufsize)){
              if (RegQueryValueEx(key, name, 0, 0, buf, &size) == 0){
                   return true;
         return false;
    //Get the path to the runtime environment
    bool InvokeJVM::GetPublicJREHome(char *buf, int bufsize){
         HKEY key, subkey;   
         char version[MAX_PATH];  
         /* Find the current version of the JRE */
         if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, JRE_KEY,0,KEY_READ,&key)!=0){
              //LogError("Error opening registry key '" JRE_KEY "'\n");          
              return false;   
         if(!GetStringFromRegistry(key,"CurrentVersion",(unsigned char *)version, sizeof(version))){
              //LogError("Failed reading value of registry key:\n\t"JRE_KEY "\\CurrentVersion\n");          
              RegCloseKey(key);          
              return false;   
         if(strcmp(version, DOTRELEASE)!= 0){
              //LogError("Registry key '" JRE_KEY "\\CurrentVersion'\nhas value '%s', but '" DOTRELEASE "' is required.\n", version);
              RegCloseKey(key);          
              return false;   
         /* Find directory where the current version is installed. */   
         if(RegOpenKeyEx(key,version,0,KEY_READ, &subkey)!= 0){
              //LogError("Error opening registry key '"JRE_KEY "\\%s'\n", version);          
              RegCloseKey(key);          
              return false;   
         if(!GetStringFromRegistry(subkey, "JavaHome", (unsigned char *)buf, bufsize)){
              //LogError("Failed reading value of registry key:\n\t"JRE_KEY "\\%s\\JavaHome\n", version);          
              RegCloseKey(key);          
              RegCloseKey(subkey);          
              return false;   
         RegCloseKey(key);   
         RegCloseKey(subkey);   
         return true;
    //Native interface call to printf
    jint JNICALL _vfprintf_(FILE *fp, const char *format, va_list args){
         //LogError(format,args);     
         return 0;
    //Native interface call if the VM exited
    void JNICALL _exit_(jint code){     
         //LogError("VM exited");     
         exit(code);
    //Native interface call if the VM aborted
    void JNICALL _abort_(void){
         //LogError("VM aborted");     
         abort();
    //Load the Java Virtual Machine
    void InvokeJVM::LoadJVM(char* dir){
         HINSTANCE handle;     
         JavaVMOption options[5];     
         char JREHome[MAX_PATH];     
         char JVMPath[MAX_PATH];                                             
         char classpathOption[MAX_PATH];     
         char librarypathOption[MAX_PATH];
         if(!GetPublicJREHome(JREHome, MAX_PATH)){          
              //LogError("Could not locate JRE");          
              abort();     
         strcpy(JVMPath,JREHome);     
         strcat(JVMPath,"\\jre\\bin\\client\\jvm.dll");
         if ((handle=LoadLibrary(JVMPath))==0) {          
              //LogError("Error loading: %s", JVMPath);          
              abort();   
         CreateJavaVM_t pfnCreateJavaVM=(CreateJavaVM_t)GetProcAddress(handle,"JNI_CreateJavaVM");
         if (pfnCreateJavaVM==0){          
              //LogError("Error: can't find JNI interfaces in: %s",JVMPath);          
              abort();     
         strcpy(classpathOption,"-Djava.class.path=");
         strcat(classpathOption,dir);     
         strcat(classpathOption,";");     
         strcat(classpathOption,JREHome);     
         strcat(classpathOption,"\\lib");     
         strcat(classpathOption,";");
         strcat(classpathOption,JREHome);     
         strcat(classpathOption,"\\lib\\comm.jar");     
         strcpy(librarypathOption,"-Djava.library.path=");     
         strcat(librarypathOption,JREHome);     
         strcat(librarypathOption,"\\lib");
         OutputDebugString("classpath option=");     
         OutputDebugString(classpathOption);     
         OutputDebugString("\n");     
         OutputDebugString("librarypath option=");     
         OutputDebugString(librarypathOption);     
         OutputDebugString("\n");
         options[0].optionString=classpathOption;
         options[1].optionString=librarypathOption;          
         options[2].optionString="vfprintf";     
         options[2].extraInfo=_vfprintf_;     
         options[3].optionString="exit";     
         options[3].extraInfo=_exit_;     
         options[4].optionString="abort";     
         options[4].extraInfo=_abort_;
         vmArgs.version = JNI_VERSION_1_2;
         vmArgs.nOptions = 5;   
         vmArgs.options  = options;  
         vmArgs.ignoreUnrecognized = false;
         if(pfnCreateJavaVM(&jvm,(void**)&env, &vmArgs) != 0){
              //LogError("Could not create VM");
              abort();     
    }Winmain.cpp:
    #define WIN32_MEAN_AND_LEAN
    #define WIN32_EXTRA_LEAN
    #include <windows.h>
    #include "oglwindow.h"          // the OpenGL window class
    #include "vector.h"
    #include "engine.h"               // the engine's main class
    #include "BrimstoneEngine.h"
    #include "InvokeJVM.h"
    JNIEXPORT void JNICALL Java_HelloWorld_displayHelloWorld(JNIEnv *, jobject){
        MessageBox(NULL, "Hello From Java!", "Error", MB_OK);
        return;
    JNIEXPORT void JNICALL Java_Callbacks_nativeMethod(JNIEnv *env, jobject obj, jint depth){
      jclass cls = env->GetObjectClass(obj);
      jmethodID mid = env->GetMethodID(cls, "callback", "(I)V");
      if (mid == 0) {
        return;
      printf("In C, depth = %d, about to enter Java\n", depth);
      env->CallVoidMethod(obj, mid, depth);
      printf("In C, depth = %d, back from Java\n", depth);
    JNINativeMethod methods[] = {"nativeMethod","()V", Java_Callbacks_nativeMethod};
    WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR, int nCmdShow){
         InvokeJVM javaVirtualMachine;
         int loopRet;
         javaVirtualMachine.running = false;
         CoInitialize(NULL);
         if (!COGLWindow::RegisterWindow(hInst)){
              MessageBox(NULL, "Failed to register window class", "Error", MB_OK);
              return -1;
         BrimstoneEngine *engine = NULL;
         try{
              char path[MAX_PATH];  
              char drive[MAX_PATH];   
              char file[MAX_PATH];   
              char dir[MAX_PATH];   
              char ext[MAX_PATH];
              jclass  cls, cls1;     
              jmethodID mid;     
              jobjectArray args;
              jint err;
              _splitpath(path,drive,dir,file,ext);          
              javaVirtualMachine.LoadJVM(dir);     
              if(javaVirtualMachine.env == NULL){               
                   MessageBox(NULL, "Could not load VM", "Error", MB_OK);
                   abort();          
              if(GetModuleFileName(NULL, path, MAX_PATH) == 0){               
                   javaVirtualMachine.LogWin32Error("Getting module filename");          
                   abort();          
              cls = javaVirtualMachine.env->FindClass("Callbacks");
              if(cls == NULL){               
                   MessageBox(NULL, "Could not find class %s (or its superclass)", "Error", MB_OK);
                   exit(-1);          
              err = javaVirtualMachine.env->RegisterNatives(cls, methods, 1 );
              mid = javaVirtualMachine.env->GetMethodID(cls, "main", "([Ljava/lang/String;)V");
              if(mid == NULL){
                   MessageBox(NULL, "Could not find method 'main'", "Error", MB_OK);
                   exit(-1);          
              args = javaVirtualMachine.env->NewObjectArray(2-2, javaVirtualMachine.env->FindClass("java/lang/String"), NULL);          
              if(args==NULL){               
                   MessageBox(NULL, "Could not create args array", "Error", MB_OK);
              for(int arg=0; arg < 2;arg++)     {               
                   javaVirtualMachine.env->SetObjectArrayElement(args, arg, javaVirtualMachine.env->NewStringUTF(argv[arg+2]));      
              javaVirtualMachine.env->CallStaticVoidMethod(cls,mid,args);     
              javaVirtualMachine.jvm->DestroyJavaVM();
              engine = new BrimstoneEngine("OpenGL Game", FALSE, 800, 600, 16);
              loopRet = engine->EnterMessageLoop();
              delete engine;
              return loopRet;
         catch(char *sz)
              MessageBox(NULL, sz, 0, 0);
              delete engine;
         CoUninitialize();
         return -1;
    }any help is always appreciated

  • Call native function fflush & strprn from java

    Hi,
    I need to call a native function fflush and stdprn from java for printing a file.
    How can i call this function?
    Can any one help me with sample code.
    Thanks,
    rpalanivelu

    Thanks your reply,
    Actually my problem is need to take printout using dot matrix printer(text printer) with different font size.
    So, i am using native method which is available in c.
    in c program i am using fflush,stdprn and fprintf.
    Here i've attached my sample program also.
    #include <jni.h>
    #include "NativePrint.h"
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #define MAXLINE_LEN 100
    JNIEXPORT jint JNICALL
    Java_NativePrint_dotMatrixPrint(JNIEnv* env, jobject obj )
    FILE *fp;
    char filename[20];
    char line[100]; /* A line read from the file */
    int lineNumber = 0;
    /* Print control codes */
    char boldOn = 14;
    char boldOff = 20;
    char contentlenOn = 15;
    char contentlenOff = 18;
    printf("Printing from C3");
    strcpy( filename , "sayHello.c" );
    /* Open the file in read mode */
    fp = fopen( filename , "r" );
    /* Error in opening file, then exit */
    if ( fp == NULL )
    printf( "\nERROR: %s cannot be opened\n" , filename );
    exit( 1 );
    while ( fgets( line , 100 , fp ) != NULL )
    lineNumber++; /* Line we are about to process next */
    printf("%s",line);
    /* If this is the first line */
    if ( lineNumber == 1 )
    /* then print it in bold */
    //fprintf( stdprn , "%c" , boldOn );
    fprintf( stdprn , "%c" , contentlenOn );
    fprintf( stdprn , line );
    fprintf( stdprn , "%c" , contentlenOff);
    //fprintf( stdprn , "%c" , boldOff );
    else
    /* else print it in normal mode */
    fprintf( stdprn , line );
    fflush(stdprn);
    return 0;

  • Can i pass an int * to a native function?

    From Java, can I pass an int pointer to the JNI?
    I want the native function to assign data to an int in the Java program.
    Many thanks!

    838478 wrote:
    Many thanks to both of you for your helpful responses. I pitched my original question somewhat disingenuously in order to be precise. My actual development issue is broader:
    I have C++ API that passes many data types by reference (as pointers or references) in order to modify the passed values. If I were to wrap this API to call it from from Java it sounds as though passing each parameter as an object (e.g. Integer for int would be the cleanest way to go. Does this sound correct?
    One enigma: I have to call a native function with a char * argument that returns with that char * pointing to a buffer of binary data. How should I pass back that binary buffer to Java? As a String? Your problem is not specific enough.
    1. You want to create data, regardless of the type, on the native heap and pass it through java to another native method. Solution: Use a long. You have a pointer to the data (again the type does NOT matter), you cast it to a long, you return that from your first method, pass it into the second, and there you cast the long back to the pointer. The pointer can point to anything you like including complex data types.
    2. You want to create data, of some complex structure, on the native heap and then access that data in java. Then you MUST map it to java types, every piece of data, of every type, specific to the type. So a native int maps to a java int (if the sizes match), a char* maps to a String, etc. You MUST create in some fashion every java data item that you need. There are NO shortcuts.

  • How to compile and creat JAR with native function

    Hi there,
    I wrote some native function for J2ME. But it seems like using J2ME wireless Toolkits, we can not compile native function. Is it right?
    Is anyone knowing how to compile and make JAR with J2MEWTK or command line?
    Thanks,
    Merry Christmas!!

    [zack327],
    JNI like or native interfaces APIs is not supported in the CLDC/MID Profile 1.0 specification. If you have J2ME code that includes JNI code, the J2MEWTK tool will not compile successfully for you.
    To package the compiled code to a MIDlet suite .jar file, use the 'Package' command in the J2MEWTK toolkit. It is found on the top menu bar 'Project' option as item on the dropdown list.
    To package the MIDlets into a MIDlet suite .jar file from the command line, you can execute the usual jar file command:
    jar cf MyMIDletSuite.jar Midlet.class
    You will also need to create a MIDlet .jad Application Descriptor file as well.
    HTH.
    Allen Lai
    Developer Technical Support
    SUN Microsystems
    http://www.sun.com/developers/support/

  • Problem calling native functions

    Ok, I generate a dll with some native functions, but when I want to use one of the native functions I get the error:
    java.lang.UnsatisfiedLinkError: pruebas.TestClass.myFunction(II)I
    where pruebas.TestClass is the class that class the native function myFunction(int, int)...
    I get the same error when I do not load the dll, can somebody help me solve this error
    thanks a lot
    God bless you
    --Chema                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    hmm, never done this on windows so I can't be too sure. You can try setting java.library.path and see if it helps.
    http://www.inonit.com/cygwin/jni/helloWorld/load.html
    (the command wopuld be java -Djava.library.path=YOURPATH yourapplication)

  • Native function call

    I created a native c class which is called in a java code. when i try to execute the program , there is "java.lang.UnsatisfiedLinkError". I tried to place the dll file created in the appropriate directory, but still i get the same error.
    My java class( which tries to access the c class) is in a package which is inside another directory, will this create any problem?
    kindly help me with ur suggestions. thank you

    I am attaching the code fragments below:
    package JavaFem;
         public class FESAMDSolver extends FESolver {
         public native void cAMDorder(int neq, int[]ap, int[]ai, int[]pv);
              static {
              //System.loadLibrary("testamd");
              System.load("Z:/testamd.dll");
              public void solve() {
         cAMDorder(num_eqns, Ap, Ai, pVector); // calling the native C method
    My native function code :
    #include <jni.h>
    #include "JavaFem_0005cFESAMDSolver.h"
    #include "amd.h"
    JNIEXPORT void JNICALL Java_JavaFem_0005cFESAMDSolver_cAMDorder
    (JNIEnv *env, jobject obj, jint n, jintArray ApArray , jintArray AiArray, jintArray PArray)
              jintArray Ap = (*env)->GetIntArrayElements(env, ApArray, 0);
              jintArray Ai = (*env)->GetIntArrayElements(env, AiArray, 0);
              jintArray P = (*env)->GetIntArrayElements(env, PArray, 0);
              (void) amd_order (n, Ap, Ai, P, (double *) NULL, (double *) NULL) ;
    Directory structure
    JavaFemViewer\JavaFem
         JavaFem is a package inside the JavaFemViewer folder.
    My testamd.dll file and all C file objs are located inside the JavaFem directory. When i created a dll file, there was no header file generated along with it.
    The error i get is displayed below:
    java.lang.UnsatisfiedLinkError: cAMDorder
    at JavaFem.FESAMDSolver.cAMDorder(Native Method)

  • Synchronization of native functions

    can i declare a native function in my class with synchronization keyword e.g.
    synchronized public native short fnMyFunc();
    although the compiler doesnot throw any error, is this function actually synchronized at runtime?
    please help

    can i declare a native function in my class with
    synchronization keyword e.g.
    synchronized public native short fnMyFunc();
    although the compiler doesnot throw any error, is this
    function actually synchronized at runtime?
    Yes. Synchronization happens before the actual call so java has no problem doing that in JNI.
    Keep in mind however that you can still produce a deadlock in C++ if you call the wrong thing (just as you could in java.)

  • Exception thrown in native function.

    Hello,
    I've encountered a bizarre, yet repetitive problem with
    Dreamweaver 8. Whenever I close out of any file (.htm, .cfm, .dwt
    for example) that contains any JavaScript I get the following error
    and then DW crashes:
    While executing DWMenu_File_Close command in menus.xml, the
    following JavaScript error(s) occurred:
    Exception thrown in native function.
    I've been working with Dreamweaver for a few years, gone to
    MAX, my partner is a certified professional, and a user group
    manager. I can't fix this problem. It's got to be related to my
    system, as she has no problems whatsoever. I've been through the
    newsgroups, the technotes, developer center, and a reloaded my
    system (XP Pro) a few times.
    Thanks - David

    You can try this simple fix -
    Quit DW.
    Find this file -
    C:\Documents and Settings\<username>\Application
    Data\Macromedia\Dreamweaver
    8\Configuration\WinFileCache-*.dat
    (these folders are normally hidden - you may have to use
    Explorer > Tools >
    Folder Options to unhide them)
    and delete it.
    Restart DW. Works better?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "lotuseducation" <[email protected]> wrote
    in message
    news:e3a6up$ckl$[email protected]..
    > hi
    >
    > i am facing a strange error in my DW 8,
    > the error message is :
    >
    > while executing onLoad, the following Javascript
    error(s) occurred:
    > at line 36 of file "E:\Program
    files\Macromedia\Dreamweaver
    > 8\Configuration\Commands\_afterSave.htm":
    > Exception thrown in native function.
    >
    > what to do now? any idea
    >
    > i did not find any solution in google search for this
    >
    > thanks in advance
    > ashok sharma
    >

  • Found no handler for remote function module SPC_GET_PRICING_PROCEDURE_INFO

    Hi
    We are on CRM 7.0 with ECC 6.0 as backend system.
    I have maintained all the settings that are required to create a sales order.
    But i am getting one error in header area::
    Found no handler for remote function module SPC_GET_PRICING_PROCEDURE_INFO
    Could any one provide me information on this.
    Thanks in advance

    Hi,
    Check this note.
    884991
    Your problem is related to VMC
    Feel free to revert back.
    -=-Ragu

  • Action for handling YES/NO functionality in create_popup_to_confirm

    Hi all,
    I am creating several Popup window in the View using method create_popup_to_confirm of interface IF_WD_WINDOW_MANAGER.Is there any restrictions of creating Actions YES/NO only for button kind 'YESNO'.
    For each Popup can i create different actons for handling corresponding functionalities in different Methods.
    Can i use any suitable Action name for handling YES/NO functionality.
    Points will be sured.
    Thanks
    Sanket sethi

    Hi Sanket,
    Yes you can make the actions as you want by assigning the action name to YES/NO events.
    call method lr_wd_window_manager->create_popup_to_confirm
            exporting
              text         = lt_text
              button_kind  = '4'
              window_title = 'title'
            receiving
              result       = lr_wd_window.
      lr_wd_window->subscribe_to_button_event(
             exporting
               button            = if_wd_window=>co_button_yes
               action_name       = 'ACT_YES'
               action_view       = lr_view_controller
    lr_wd_window->subscribe_to_button_event(
            exporting
              button            = if_wd_window=>co_button_no
              action_name       = 'ACT_NO'
              action_view       = lr_view_controller
    Regards
    Amol Deshmukh

  • Using C functions with JNI

    Hello,
    I am just looking at JNI for the first time today. I have to write some utility functions in C for the a linux Red Hat 7 server, and then be able to call them from java applications. I am having some trouble when I try and compile the c source. I am not sure if this is a C error directly, or caused by the java. I am really sorry if this is a C error, its been awhile! I am simply trying to runt the demo on the java.sun.com site. Here is my code:
    The Java:
    public class HelloWorld {
    public HelloWorld() {
    public native void displayHelloWorld();
    static {
    System.loadLibrary("hello");
    public static void main(String[] args) {
    new JNITest2().displayHelloWorld();
    The c file:
    #include <jni.h>
    #include "JNITest2.h"
    #include <stdio.h>
    JNIEXPORT void JNICALL
    Java_HelloWorld_displayHelloWorld(JNIEnv *env, jobject obj)
    printf("Hello world!\n");
    return;
    The .h file:/* DO NOT EDIT THIS FILE - it is machine generated */
    #include <jni.h>
    /* Header for class HelloWorld */
    #ifndef IncludedHelloWorld
    #define IncludedHelloWorld
    #ifdef __cplusplus
    extern "C" {
    #endif
    * Class: HelloWorld
    * Method: displayHelloWorld
    * Signature: ()V
    JNIEXPORT void JNICALL Java_HelloWorld_displayHelloWorld
    (JNIEnv *, jobject);
    #ifdef __cplusplus
    #endif
    #endif
    The Error I Get:
    [2943UK@hercules classes]# cc -g -I/usr/local/jdk1.3/include -I/usr/local/jdk1.3/include/linux HelloWorldImp.c -o libhello.so
    /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o: In function `_start':
    /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../crt1.o(.text+0x18): undefined reference to `main'
    collect2: ld returned 1 exit status
    Thanks in advance to anyone who knows the answer and can help me.
    Ian

    Sorry, Here is the java source I am using:
    public class HelloWorld {
    public HelloWorld() {
    public native void displayHelloWorld();
    static {
    System.loadLibrary("hello");
    public static void main(String[] args) {
    new HelloWorld().displayHelloWorld();
    }

  • Error calling function in JNI

    Hi,
    I get the following error message when trying to run a JNI application on a Mac. The application runs fine under Windows and I am trying to port to a Mac and am struggling. I've also copied the declarations and definition from the java and c++ header and source files.
    The problem appears to be the calling of the function initWindows as the debugging print statement on the c++ is never displayed.
    "Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: initWindows
         at AvistoGL.initWindows(Native Method)"
    Java file declaration
    public native boolean initWindows();
    Header file declaration
    JNIEXPORT jboolean JNICALL Java_AvistoGL_initWindows (JNIEnv *, jobject);
    cpp file definition
    JNIEXPORT jboolean JNICALL Java_AvistoGL_initWindows(JNIEnv *env, jobject panel)
         std::cout<< "Inside Java_AvistoGL_initWindows"<< std::endl;
         return InitWindowMac(env, panel);
    }

    You include the h file in the cpp file?
    The cpp method is NOT part of any C++ class right?
    What is the package for the java method?
    You load the library in java and do not eat exceptions?

Maybe you are looking for

  • Importing HD from a Sony HDR-CX7

    Apologies for this crazy question, but the last time I was using iMovie was over a year ago (version 08). There were two problems with importing HD footage from my Sony HDR-CX7: (1) iMovie didn't correctly compress it, and the file size(s) ended up b

  • ADF Deployment Problem

    HI All, I have created the jspx page which uses the data control. DataControls are created from EJBSession Bean Everything works fine in jdeveloper, But when I deploy to iAS 10.1.3.3 getting "Page cannot be displayed" I verified the log, here is the

  • AIX 5L's HACMP on Database Servers

    Hello everyone, I've been looking around for information on a 4 node SAP ERP/Oracle RAC architecture for AIX 5L and I'm being constantly lead to vendors being responsible for the clustering requirements. I'm trying to setup a 4-server ERP architectur

  • How to improve/boost cell signal in Rural area?

    I live in rural GA and on the edge of the Verizon 3G/1X coverage. Presently, I have dial-up for internet access which is ungodly slow; I am wanting to know if there is any equipment that can boost/improve the cellular signal to possibly use a Verizon

  • Is there a way to turn back on the zooming effect without the paralex effect in IOS 7.0.3?

    Is there a way to turn back on the zooming effect without the paralex effect in IOS 7.0.3?