scaladotnet icon indicating copy to clipboard operation
scaladotnet copied to clipboard

scalacompiler.exe runtime error with mono 2.10.8

Open robertlj opened this issue 12 years ago • 3 comments

In trying to run the scalacompiler.exe with Mono 2.10.8 (running on Windows 7/8 & Ubuntu) I received this error:

mono scalacompiler.exe

===============================================> (Start of Error Message)

Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for scala.tools.nsc.Main$ ---> System.TypeInitializationException: An exception was thrown by the type initializer for scala.tools.nsc.Properties$ ---> System.TypeInitializationException: An exception was thrown by the type initializer for scala.Predef$ ---> System.TypeInitializationException: An exception was thrown by the type initializer for scala.package$ ---> System.TypeInitializationException: An exception was thrown by the type initializer for scala.collection.Traversable$ ---> System.TypeInitializationException: An exception was thrown by the type initializer for java.lang.Throwable ---> System.TypeInitializationException: An exception was thrown by the type initializer for Object ---> System.TypeLoadException: A type load exception has occurred.

at IKVM.Internal.ClassLoaderWrapper.LoadClassCritical (System.String name) [0x00000] in :0

at IKVM.Internal.CoreClasses+java+lang+Object..cctor () [0x00000] in :0

--- End of inner exception stack trace ---

at IKVM.Internal.CompiledTypeWrapper.GetBaseTypeWrapper (System.Type type) [0x00000] in :0

at IKVM.Internal.CompiledTypeWrapper..ctor (System.String name, System.Type type) [0x00000] in :0

at IKVM.Internal.CompiledTypeWrapper+CompiledRemappedTypeWrapper..ctor (System.String name, System.Type type) [0x00000] in :0

at IKVM.Internal.CompiledTypeWrapper.newInstance (System.String name, System.Type type) [0x00000] in :0

at IKVM.Internal.AssemblyClassLoader+AssemblyLoader.CreateWrapperForAssemblyType (System.Type type) [0x00000] in :0

at IKVM.Internal.AssemblyClassLoader.GetWrapperFromAssemblyType (System.Type type) [0x00000] in :0

at IKVM.Internal.BootstrapClassLoader.GetWrapperFromAssemblyType (System.Type type) [0x00000] in :0

at IKVM.Internal.ClassLoaderWrapper.GetWrapperFromType (System.Type type) [0x00000] in :0

at IKVM.NativeCode.ikvm.runtime.Util.getFriendlyClassFromType (System.Type type) [0x00000] in :0

at ikvm.runtime.Util.getFriendlyClassFromType (System.Type t) [0x00000] in :0

at java.lang.Class.op_Implicit (System.Type type) [0x00000] in :0

at IKVM.Internal.ExceptionHelper.getPersistentFields () [0x00000] in :0

at java.lang.Throwable..cctor () [0x00000] in :0

--- End of inner exception stack trace ---

at scala.util.control.BreakControl..ctor () [0x00000] in :0

at scala.util.control.Breaks..ctor () [0x00000] in :0

at scala.collection.Traversable$..ctor () [0x00000] in :0

at scala.collection.Traversable$..cctor () [0x00000] in :0

--- End of inner exception stack trace ---

at scala.package$..ctor () [0x00000] in :0

at scala.package$..cctor () [0x00000] in :0

--- End of inner exception stack trace ---

at scala.Predef$..ctor () [0x00000] in :0

at scala.Predef$..cctor () [0x00000] in :0

--- End of inner exception stack trace ---

at scala.tools.nsc.Properties$.pickJarBasedOn () [0x00000] in :0

at scala.util.PropertiesTrait$class.scalaProps (PropertiesTrait $this) [0x00000] in :0

at scala.tools.nsc.Properties$.scalaProps () [0x00000] in :0

--- End of inner exception stack trace ---

at scala.tools.nsc.Driver..ctor () [0x00000] in :0

at scala.tools.nsc.Main$..ctor () [0x00000] in :0

at scala.tools.nsc.Main$..cctor () [0x00000] in :0

--- End of inner exception stack trace ---

at <Module>.Main (System.String[] args) [0x00000] in :0 [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for scala.tools.nsc.Main$ ---> System.TypeInitializationException: An exception was thrown by the type initializer for scala.tools.nsc.Properties$ ---> System.TypeInitializationException: An exception was thrown by the type initializer for scala.Predef$ ---> System.TypeInitializationException: An exception was thrown by the type initializer for scala.package$ ---> System.TypeInitializationException: An exception was thrown by the type initializer for scala.collection.Traversable$ ---> System.TypeInitializationException: An exception was thrown by the type initializer for java.lang.Throwable ---> System.TypeInitializationException: An exception was thrown by the type initializer for Object ---> System.TypeLoadException: A type load exception has occurred.

at IKVM.Internal.ClassLoaderWrapper.LoadClassCritical (System.String name) [0x00000] in :0

at IKVM.Internal.CoreClasses+java+lang+Object..cctor () [0x00000] in :0

--- End of inner exception stack trace ---

at IKVM.Internal.CompiledTypeWrapper.GetBaseTypeWrapper (System.Type type) [0x00000] in :0

at IKVM.Internal.CompiledTypeWrapper..ctor (System.String name, System.Type type) [0x00000] in :0

at IKVM.Internal.CompiledTypeWrapper+CompiledRemappedTypeWrapper..ctor (System.String name, System.Type type) [0x00000] in :0

at IKVM.Internal.CompiledTypeWrapper.newInstance (System.String name, System.Type type) [0x00000] in :0

at IKVM.Internal.AssemblyClassLoader+AssemblyLoader.CreateWrapperForAssemblyType (System.Type type) [0x00000] in :0

at IKVM.Internal.AssemblyClassLoader.GetWrapperFromAssemblyType (System.Type type) [0x00000] in :0

at IKVM.Internal.BootstrapClassLoader.GetWrapperFromAssemblyType (System.Type type) [0x00000] in :0

at IKVM.Internal.ClassLoaderWrapper.GetWrapperFromType (System.Type type) [0x00000] in :0

at IKVM.NativeCode.ikvm.runtime.Util.getFriendlyClassFromType (System.Type type) [0x00000] in :0

at ikvm.runtime.Util.getFriendlyClassFromType (System.Type t) [0x00000] in :0

at java.lang.Class.op_Implicit (System.Type type) [0x00000] in :0

at IKVM.Internal.ExceptionHelper.getPersistentFields () [0x00000] in :0

at java.lang.Throwable..cctor () [0x00000] in :0

--- End of inner exception stack trace ---

at scala.util.control.BreakControl..ctor () [0x00000] in :0

at scala.util.control.Breaks..ctor () [0x00000] in :0

at scala.collection.Traversable$..ctor () [0x00000] in :0

at scala.collection.Traversable$..cctor () [0x00000] in :0

--- End of inner exception stack trace ---

at scala.package$..ctor () [0x00000] in :0

at scala.package$..cctor () [0x00000] in :0

--- End of inner exception stack trace ---

at scala.Predef$..ctor () [0x00000] in :0

at scala.Predef$..cctor () [0x00000] in :0

--- End of inner exception stack trace ---

at scala.tools.nsc.Properties$.pickJarBasedOn () [0x00000] in :0

at scala.util.PropertiesTrait$class.scalaProps (PropertiesTrait $this) [0x00000] in :0

at scala.tools.nsc.Properties$.scalaProps () [0x00000] in :0

--- End of inner exception stack trace ---

at scala.tools.nsc.Driver..ctor () [0x00000] in :0

at scala.tools.nsc.Main$..ctor () [0x00000] in :0

at scala.tools.nsc.Main$..cctor () [0x00000] in :0

--- End of inner exception stack trace ---

at <Module>.Main (System.String[] args) [0x00000] in :0

===============================================> (End of Error Message)

robertlj avatar Apr 12 '12 15:04 robertlj

Robert,

Due to lack of manpower we're testing Scala.NET only on Windows OSes.

For example, there's at least one area where a Windows-only API is being used (line 742 at [1]):

val typ =
  if (fieldInfo.FieldType.IsEnum) {
    // now comes a .NET 4.0 API call, and UnderlyingSystemType doesn't do the trick. Can another (old) API be used instead?
     fieldInfo.FieldType.GetEnumUnderlyingType
   } else {
     fieldInfo.FieldType
   }

That's how it looks for the time being.

Miguel

[1] https://github.com/magarciaEPFL/scaladotnet/blob/master/src/compiler/scala/tools/nsc/backend/msil/GenMSIL.scala

magarciaEPFL avatar Apr 12 '12 17:04 magarciaEPFL

I am using mono 2.10.9 on a Mac, and got the same error.

cuipengfei avatar Oct 07 '12 07:10 cuipengfei

is this fixed now?

cuipengfei avatar May 02 '13 16:05 cuipengfei