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

