[Ikvm-developers] AppDomain problem with JRuby
Brought to you by:
jfrijters
From: SK <ju...@s1...> - 2007-06-27 16:16:26
|
JRuby doesn't work in user created AppDomain. It's thrown java.lang.NoClassDefFoundError. but it's working fine in default AppDomain. IKVM.NET version : 0.34.0.3 and 0.35.2734 (Hybrid) JRuby version : 1.0 ikvmc options : ikvmc -target:library jruby-complete-1.0.jar // DefaultDomain.cs // References : // IKVM.GNU.Classpath.dll (or IKVM.Hybrid.GNU.Classpath.OpenJDK.dll) // IKVM.Runtime.dll // jruby-complete-1.0.dll using System; using org.jruby; class Program { static void Main(string[] args) { AppDomain domain = AppDomain.CurrentDomain; domain.DoCallBack(new CrossAppDomainDelegate(delegate { Ruby ruby = Ruby.getDefaultInstance(); ruby.evalScript("puts 'Running JRuby'"); // OK })); } } // UserDomain.cs // References : // IKVM.GNU.Classpath.dll (or IKVM.Hybrid.GNU.Classpath.OpenJDK.dll) // IKVM.Runtime.dll // jruby-complete-1.0.dll using System; using org.jruby; class Program { static void Main(string[] args) { AppDomain domain = AppDomain.CreateDomain("jruby_domain"); domain.DoCallBack(new CrossAppDomainDelegate(delegate { Ruby ruby = Ruby.getDefaultInstance(); // throw java.lang.NoClassDefFoundError ruby.evalScript("puts 'Running JRuby'"); })); } } |