View Single Post
  #1 (permalink)  
Old 04-27-2004
chappich chappich is offline
Registered User
 
 
Join Date: Apr 2004
Location: Bielefeld, Germany
Posts: 5
Unhappy [JNI] Java VM aborts on Ice::initialize

Hi,

I am trying to write a JNI wrapper for a library that uses ICE. It did not work and after
some debugging I found out that it seems to be ICE, to be specific Ice::initialize().

The Java VM crashes with a simple "unexpected exception" out of my control. I thought
about threads in general, but a simple pthreads example caused no problems. I tried
catching exceptions from Ice::initialize(), but none came. Some other ICE routines caused
no problems, either.

Did anyone have a similar problem with JNI and ICE? Is there anybody else who tried
something linke that?
Maybe it's just my machine or I missed something very, very important ...

I wrote some code which crashes for me. Thanks in advance for any help,

Christoph


File Demo.java
Code:
public class Demo {
        public static void main ( String[] _ ) {
                System.loadLibrary( "Demo" );
                jniDemo();
        }

        private static native void jniDemo ();
}
File Demo.cc
Code:
#include <Ice/Ice.h>
#include "Demo.h"

JNIEXPORT void JNICALL Java_Demo_jniDemo ( JNIEnv *, jclass ) {
        int a;
        Ice::initialize( a, 0 );
}
'best of' error message
Code:
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : 11 occurred at PC=0x810DFE7
Function=[Unknown.]
Library=(N/A)
Demo.h was created with javah -jni -o Demo.h Demo
libDemo.so was build by g++ -shared -o libDemo.so -lIce

I am using Suse Linux, Kernel 2.4.20, GCC 3.2.3, Ice 1.3, Java 1.4.0

Last edited by chappich : 04-27-2004 at 01:12 PM.
Reply With Quote