NoSuchMethodException when calling the constructor

This code in my C++-App:

int res = JNI_CreateJavaVM( &jvm, (void**) &env, &args );

ExceptionProver(env);

if( res < 0 )

{

MessageBox("Fehler beim Erstellen der Virtual Machine. 3","JVM Creation Error", MB_OK);

}else{

MessageBox("VM successfully created!","Success", MB_OK);

}

jclass clazz = env->FindClass("com/eads/geodatainterface/GeoDataInterface");

ExceptionProver(env);

jmethodID constrID = env->GetMethodID(clazz,"<init>","(II)V"); <-- Returnsnull

ExceptionProver(env);

Causes a NoSuchMethodExcpetion when i call the following Java class:

publicclass GeoDataInterface{

GeoDataCore core =null;

BufferedImage image;

ByteArrayOutputStream ostream =new ByteArrayOutputStream();

public GeoDataInterface(int viewXPixelWidth,int viewYPixelHeight){

image =new BufferedImage(viewXPixelWidth, viewYPixelWidth, BufferedImage.TYPE_3BYTE_BGR);

core = GeoDataCore.createInstanceOfCore( image, viewXPixelWidth, viewYPixelWidth);

core.requestUserInputs();

//core.createSVG();

}

publicbyte[] getBitmap(double x1,double y1,double x2,double y2,double x3,double y3,double x4,double y4){

try{

Envelope en =new Envelope(y1, x1, y2, x2);

core.renderClipping(en);

ImageIO.write(image,"bmp", ostream);

return ostream.toByteArray();

}catch(Exception ex){

System.out.println("Error while creating a bitmap: " + ex.toString());

returnnull;

}

}

publicvoid destroyCore(){

core.finalize();

}

publicstaticvoid main(String[] args){

GeoDataInterface geoDataInterface =new GeoDataInterface(1024, 768);

}

}

My virtual machine is created successfully and the FindClass-function returns also a valid class.

Any ideas? Thanks in advance!

Message was edited by:

OliverSchwarz

[3834 byte] By [OliverSchwarza] at [2007-10-3 0:04:29]
# 1

I solved my problem!

The Jbuilder9 (with JDK5.0) created my archiv with the following methods:

public class GeoDataInterface();

public static void main();

So jni could not find a method with (II)V.

Jbuilder9 with JDK 1.4.2 created a archiv with valid methods!

OliverSchwarza at 2007-7-14 16:52:31 > top of Java-index,Java HotSpot Virtual Machine,Specifications...