[Mono-list] XSP and IKVM error

Jeroen Frijters jeroen at sumatra.nl
Fri Sep 23 17:39:49 EDT 2005


Miguel de Icaza wrote:
> Can you explain what the limitation is of using IKVM in a separate
> domain?  Is this something we can help addressing?

Note that this only applies to Java code that uses native libraries and
I think it cannot be solved. You cannot load multiple "instances" of a
shared library in a process (at least not in Windows and I assume the
same is true in most platforms, at least not without some complicated
platform specific trickery).

Calling the same library from different AppDomains (which effectively
equates to different instances of IKVM) means that the native library
will get confused. What Lukasz was seeing was the result of something
that is very typical in JNI code, the native library is caching a
jfieldID (which IKVM implements as a GCHandle) that it obtained from one
AppDomain in a global variable and then attempted to use it in another
AppDomain. The native code is obviously not aware of the possibility
that it can be called from different AppDomains (since Java doesn't
(yet) have such a construct).

Regards,
Jeroen


More information about the Mono-list mailing list