• Post Reply Bookmark Topic Watch Topic
  • New Topic

Moving JNI objects to other shared libraries

 
Charles Walter
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

Anyone have any successful experience passing JNI objects through a dlopen call? In my secondary library the JNIEnv pointer arrives fine, and can be used for things like FindClass and GetMethodID, but whenever I try to operate on the jObjectArray passed alongside it I get a VM crash in
JNIEnv_::GetObjectArrayElement(_jobjectArray*).

I need to build a safe wrapper for our Java customers to allow them to make their own JNI calls, which will load the library and execute their code.

Is this even possible? Thanks for any ideas.

-Charles
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

I am not at all sure about this, but have you tried creating global references and passing those to the secondary DLL?
 
Charles Walter
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alas it was merely a problem with the ordering of the arguments! Thanks for the idea and the welcome.

-Charles
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!