Calico Java stopped working on Mac/Windows

Issue #5 resolved
Doug Blank created an issue

Since the update of the IKVM libraries from Mono for Calico Java, Calico Java has stopped working on Mac and Windows. Related to #3 and #4.

Before: starting calico with Java enabled gave no error message

Now: starting calico with Java enabled gives: "An exception was thrown by the type initializer for edu.rice.cs.dynamicjava.Options"

Comments (12)

  1. Keith O'Hara
    >>> import clr
    >>> clr.AddReference("drjava")
    >>> import edu
    >>> options = edu.rice.cs.dynamicjava.Options.DEFAULT
    Missing method System.Reflection.Assembly::op_Equality(Assembly,Assembly) in assembly /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/2.0/mscorlib.dll, referenced in assembly /private/tmp/calico/languages/Java/lib/IKVM.Runtime.dll
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    SystemError: An exception was thrown by the type initializer for edu.rice.cs.dynamicjava.Options
    
  2. Keith O'Hara

    Running with --runtime=4.0 made the Missing method warning/error go away but the exception remains. So weird that it runs fine on linux but not on mac os x.

  3. Keith O'Hara

    I created a small driver C# app and I got this mammoth error:

    Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for edu.rice.cs.dynamicjava.Options ---> System.TypeInitializationException: An exception was thrown by the type initializer for edu.rice.cs.dynamicjava.symbol.ExtendedTypeSystem ---> System.TypeInitializationException: An exception was thrown by the type initializer for edu.rice.cs.dynamicjava.symbol.StandardTypeSystem ---> System.TypeInitializationException: An exception was thrown by the type initializer for edu.rice.cs.dynamicjava.symbol.TypeSystem ---> System.NotSupportedException: RunAndCollect not yet supported.
      at System.Reflection.Emit.AssemblyBuilder..ctor (System.Reflection.AssemblyName n, System.String directory, AssemblyBuilderAccess access, Boolean corlib_internal) [0x00000] in <filename unknown>:0
      at System.AppDomain.DefineDynamicAssembly (System.Reflection.AssemblyName name, AssemblyBuilderAccess access, System.String dir, System.Security.Policy.Evidence evidence, System.Security.PermissionSet requiredPermissions, System.Security.PermissionSet optionalPermissions, System.Security.PermissionSet refusedPermissions, Boolean isSynchronized) [0x00000] in <filename unknown>:0
      at (wrapper remoting-invoke-with-check) System.AppDomain:DefineDynamicAssembly (System.Reflection.AssemblyName,System.Reflection.Emit.AssemblyBuilderAccess,string,System.Security.Policy.Evidence,System.Security.PermissionSet,System.Security.PermissionSet,System.Security.PermissionSet,bool)
      at System.AppDomain.DefineDynamicAssembly (System.Reflection.AssemblyName name, AssemblyBuilderAccess access) [0x00000] in <filename unknown>:0
      at (wrapper remoting-invoke-with-check) System.AppDomain:DefineDynamicAssembly (System.Reflection.AssemblyName,System.Reflection.Emit.AssemblyBuilderAccess)
      at DynamicMethodUtils.Create (System.String name, System.Type owner, Boolean nonPublic, System.Type returnType, System.Type[] paramTypes) [0x00000] in <filename unknown>:0
      at IKVM.NativeCode.sun.reflect.ReflectionFactory+FastConstructorAccessorImpl..ctor (java.lang.reflect.Constructor constructor) [0x00000] in <filename unknown>:0
      at IKVM.NativeCode.sun.reflect.ReflectionFactory.newConstructorAccessor0 (System.Object thisFactory, System.Object constructor) [0x00000] in <filename unknown>:0
      at sun.reflect.ReflectionFactory.newConstructorAccessor0 (java.lang.reflect.Constructor ) [0x00000] in <filename unknown>:0
      at sun.reflect.ReflectionFactory.newConstructorAccessor (java.lang.reflect.Constructor c) [0x00000] in <filename unknown>:0
      at java.lang.reflect.Constructor.acquireConstructorAccessor () [0x00000] in <filename unknown>:0
      at java.lang.reflect.Constructor.newInstance (System.Object[] initargs, ikvm.internal.CallerID ) [0x00000] in <filename unknown>:0
      at edu.rice.cs.plt.reflect.ReflectUtil.loadObject (java.lang.ClassLoader loader, System.String className, java.lang.Class[] constructorSig, System.Object[] constructorArgs) [0x00000] in <filename unknown>:0
      at edu.rice.cs.plt.reflect.ReflectUtil.loadObject (java.lang.ClassLoader loader, System.String className, System.Object[] constructorArgs) [0x00000] in <filename unknown>:0
      at edu.rice.cs.dynamicjava.symbol.SymbolUtil.wrapClass (java.lang.Class c) [0x00000] in <filename unknown>:0
      at edu.rice.cs.dynamicjava.symbol.TypeSystem..cctor () [0x00000] in <filename unknown>:0
      --- End of inner exception stack trace ---
      at edu.rice.cs.dynamicjava.symbol.StandardTypeSystem..cctor () [0x00000] in <filename unknown>:0
      --- End of inner exception stack trace ---
      at edu.rice.cs.dynamicjava.symbol.ExtendedTypeSystem..cctor () [0x00000] in <filename unknown>:0
      --- End of inner exception stack trace ---
      at edu.rice.cs.dynamicjava.Options.typeSystemFactory () [0x00000] in <filename unknown>:0
      at edu.rice.cs.dynamicjava.Options..ctor () [0x00000] in <filename unknown>:0
      at edu.rice.cs.dynamicjava.Options..cctor () [0x00000] in <filename unknown>:0
      --- End of inner exception stack trace ---
      at Test.Main (System.String[] args) [0x00000] in <filename unknown>:0
    [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for edu.rice.cs.dynamicjava.Options ---> System.TypeInitializationException: An exception was thrown by the type initializer for edu.rice.cs.dynamicjava.symbol.ExtendedTypeSystem ---> System.TypeInitializationException: An exception was thrown by the type initializer for edu.rice.cs.dynamicjava.symbol.StandardTypeSystem ---> System.TypeInitializationException: An exception was thrown by the type initializer for edu.rice.cs.dynamicjava.symbol.TypeSystem ---> System.NotSupportedException: RunAndCollect not yet supported.
      at System.Reflection.Emit.AssemblyBuilder..ctor (System.Reflection.AssemblyName n, System.String directory, AssemblyBuilderAccess access, Boolean corlib_internal) [0x00000] in <filename unknown>:0
      at System.AppDomain.DefineDynamicAssembly (System.Reflection.AssemblyName name, AssemblyBuilderAccess access, System.String dir, System.Security.Policy.Evidence evidence, System.Security.PermissionSet requiredPermissions, System.Security.PermissionSet optionalPermissions, System.Security.PermissionSet refusedPermissions, Boolean isSynchronized) [0x00000] in <filename unknown>:0
      at (wrapper remoting-invoke-with-check) System.AppDomain:DefineDynamicAssembly (System.Reflection.AssemblyName,System.Reflection.Emit.AssemblyBuilderAccess,string,System.Security.Policy.Evidence,System.Security.PermissionSet,System.Security.PermissionSet,System.Security.PermissionSet,bool)
      at System.AppDomain.DefineDynamicAssembly (System.Reflection.AssemblyName name, AssemblyBuilderAccess access) [0x00000] in <filename unknown>:0
      at (wrapper remoting-invoke-with-check) System.AppDomain:DefineDynamicAssembly (System.Reflection.AssemblyName,System.Reflection.Emit.AssemblyBuilderAccess)
      at DynamicMethodUtils.Create (System.String name, System.Type owner, Boolean nonPublic, System.Type returnType, System.Type[] paramTypes) [0x00000] in <filename unknown>:0
      at IKVM.NativeCode.sun.reflect.ReflectionFactory+FastConstructorAccessorImpl..ctor (java.lang.reflect.Constructor constructor) [0x00000] in <filename unknown>:0
      at IKVM.NativeCode.sun.reflect.ReflectionFactory.newConstructorAccessor0 (System.Object thisFactory, System.Object constructor) [0x00000] in <filename unknown>:0
      at sun.reflect.ReflectionFactory.newConstructorAccessor0 (java.lang.reflect.Constructor ) [0x00000] in <filename unknown>:0
      at sun.reflect.ReflectionFactory.newConstructorAccessor (java.lang.reflect.Constructor c) [0x00000] in <filename unknown>:0
      at java.lang.reflect.Constructor.acquireConstructorAccessor () [0x00000] in <filename unknown>:0
      at java.lang.reflect.Constructor.newInstance (System.Object[] initargs, ikvm.internal.CallerID ) [0x00000] in <filename unknown>:0
      at edu.rice.cs.plt.reflect.ReflectUtil.loadObject (java.lang.ClassLoader loader, System.String className, java.lang.Class[] constructorSig, System.Object[] constructorArgs) [0x00000] in <filename unknown>:0
      at edu.rice.cs.plt.reflect.ReflectUtil.loadObject (java.lang.ClassLoader loader, System.String className, System.Object[] constructorArgs) [0x00000] in <filename unknown>:0
      at edu.rice.cs.dynamicjava.symbol.SymbolUtil.wrapClass (java.lang.Class c) [0x00000] in <filename unknown>:0
      at edu.rice.cs.dynamicjava.symbol.TypeSystem..cctor () [0x00000] in <filename unknown>:0
      --- End of inner exception stack trace ---
      at edu.rice.cs.dynamicjava.symbol.StandardTypeSystem..cctor () [0x00000] in <filename unknown>:0
      --- End of inner exception stack trace ---
      at edu.rice.cs.dynamicjava.symbol.ExtendedTypeSystem..cctor () [0x00000] in <filename unknown>:0
      --- End of inner exception stack trace ---
      at edu.rice.cs.dynamicjava.Options.typeSystemFactory () [0x00000] in <filename unknown>:0
      at edu.rice.cs.dynamicjava.Options..ctor () [0x00000] in <filename unknown>:0
      at edu.rice.cs.dynamicjava.Options..cctor () [0x00000] in <filename unknown>:0
      --- End of inner exception stack trace ---
      at Test.Main (System.String[] args) [0x00000] in <filename unknown>:0
    
  4. Keith O'Hara

    OK I rebuilt ikvm with .net 2.0 support (it was using 4.0 before) and the problem is fixed.

    ikvm-fork>nant -t:mono-2.0
    

    For some reason the 4.0 implementations were acting differently on Mac and Windows compared with Linux. Even though they were the exact same version (.NET 4.0.30319.1).

    This current version of the java dll's checked in work with java and ROS.

  5. Log in to comment