[Mono-list] XSP and IKVM error

Jeroen Frijters jeroen at sumatra.nl
Fri Sep 23 10:02:36 EDT 2005


Lukasz Piatkowski wrote:
> I'm currently trying to develop asp.net administration panel for
> subversion. I found this
> http://svn.haxx.se/users/archive-2005-05/0065.shtml to be very useful
> - using IKVM according to this method i compiled a mono libarary for
> svn, which works perfectly when used in standard console program. Now
> I'm trying to put it in asp.net page and I'm getting following error:
> when request is send back to XSP and lib methods are invoke, the
> answer for browser is just "Server error. Your client sent a request
> that was not understood by this server." and XSP itself prints:
> ---
> System.ArgumentException: GCHandle value belongs to a different domain
> in <0x00088> 
> System.Runtime.InteropServices.GCHandle:op_Explicit (IntPtr value)
> in <0x00012> MemberWrapper:FromCookieImpl (IntPtr cookie)
> in <0x0000b> FieldWrapper:FromCookie (IntPtr cookie)
> in <0x0000f> IKVM.Runtime.JNIEnv:GetFieldValue (IntPtr cookie,
> System.Object obj)
> ---
> I can't cope with this - can enybody help me?

IKVM doesn't support using JNI outside of the default AppDomain. I
assume XSP is using multiple AppDomains to host different instances of
your application (like ASP.NET does), so this will cause IKVM run into
inside multiple AppDomains and this is fine for managed code, but
unmanaged code cannot be loaded multiple times into the same process, so
the JNI code gets confused.

I don't know of any solution or workaround for this problem, but maybe
XSP has a configuration option to disable using multiple AppDomains?

Regards,
Jeroen


More information about the Mono-list mailing list