how to pass a jobject from one native code to another through messagequeue.
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   rohith_ravindran
Posted On:   Wednesday, August 23, 2006 01:49 AM

I want to send an object from from one JVM to another through message queue. for that i wrote a JNI program which takes an jobject as a parameter. now i want to pass this object to another native code throgh message queue. struct mesg{ int type; jobject sendobj; }; JNIEXPORT void JNICALL Java_server_share(JNIEnv *env,jobject obj,jobject sendobj) { struct mesg m; m.sendobj=sendobj; int ser_mq=CreateMQ(); WritetoQue(ser_mq); } when i run the program, the server program run without any errors. But at the client side i am not able to call the class of the object received.    More>>

I want to send an object from from one JVM to another through message
queue. for that i wrote a JNI program which takes an jobject as a
parameter. now i want to pass this object to another native code throgh
message queue.


struct mesg{
int type;
jobject sendobj;
};


JNIEXPORT void JNICALL Java_server_share(JNIEnv *env,jobject obj,jobject sendobj)


{
struct mesg m;
m.sendobj=sendobj;
int ser_mq=CreateMQ();
WritetoQue(ser_mq);
}


when i run the program, the server program run without any errors. But
at the client side i am not able to call the class of the object
received.


JNIEXPORT jobject JNICALL Java_client_share(JNIEnv *env,jobject obj)
{

int mqid = create();
struct mesg que=readfromque(mqid);
jobject robj=que.recvobj;


jclass cls2=(*env)->;GetObjectClass(env,robj);/* ERROR*/

return robj;
}


neither i could use the received object(return robj) to retrieve its
field.

Is there any way to send a jobject from one C code to another through
message queue or any other IPC mechanisms?
Any help is much appreciated...

   <<Less
About | Sitemap | Contact