TypeInitialisationException

User a8852677c2

18-11-2010 07:03:41

 While executing my program in .net on Virtual  Machine, i got following exception for the statement 


dim mol as molecule=MolImporter.importMol(chemicalName)


It works fine on base machine.


 



Virtual Machine


OS - WindowsXP SP2


.net framework 2.0


jre6.0


 


See the end of this message for details on invoking 


just-in-time (JIT) debugging instead of this dialog box.


 


************** Exception Text **************


System.TypeInitializationException: The type initializer for 'chemaxon.formats.MFileFormatUtil' threw an exception. ---> System.MissingMethodException: Method not found: 'Void System.Reflection.Emit.DynamicMethod..ctor(System.String, System.Type, System.Type[], Boolean)'.


   at DynamicMethodUtils.Create(String name, Type owner, Boolean nonPublic, Type returnType, Type[] paramTypes)


   at IKVM.NativeCode.sun.reflect.ReflectionFactory.FieldAccessorImplBase.GenerateFastGetter(Type delegateType, Type fieldType, FieldWrapper fw)


   at IKVM.NativeCode.sun.reflect.ReflectionFactory.FieldAccessorImplBase.FastObjectFieldAccessor.lazyGet(Object obj)


   at IKVM.NativeCode.sun.reflect.ReflectionFactory.FieldAccessorImplBase.FastObjectFieldAccessor.get(Object obj)


   at java.lang.reflect.Field.get(Object obj, CallerID )


   at chemaxon.formats.MFileFormatUtil.processRegistry(String )


   at chemaxon.formats.MFileFormatUtil..cctor()


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


   at chemaxon.formats.MFileFormatUtil.splitFormatAndOptions(String str)


   at chemaxon.formats.MolImporter.init(InputStream , String , String , String )


   at chemaxon.formats.MolImporter..ctor(InputStream is, String str1, String str2)


   at chemaxon.formats.MolImporter.importMol(Byte[] barr, String str1, String str2)


   at chemaxon.formats.MolImporter.importMol(String str)


   at Trial.Form3.Button1_Click(Object sender, EventArgs e)


   at System.Windows.Forms.Control.OnClick(EventArgs e)


   at System.Windows.Forms.Button.OnClick(EventArgs e)


   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)


   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)


   at System.Windows.Forms.Control.WndProc(Message& m)


   at System.Windows.Forms.ButtonBase.WndProc(Message& m)


   at System.Windows.Forms.Button.WndProc(Message& m)


   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)


   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)


   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


 


 


************** Loaded Assemblies **************


mscorlib


    Assembly Version: 2.0.0.0


    Win32 Version: 2.0.50727.42 (RTM.050727-4200)


    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll


----------------------------------------


Trial


    Assembly Version: 1.0.0.0


    Win32 Version: 1.0.0.0


    CodeBase: file:///C:/Documents%20and%20Settings/grid/Desktop/TestProgram/Trial.exe


----------------------------------------


Microsoft.VisualBasic


    Assembly Version: 8.0.0.0


    Win32 Version: 8.0.50727.42 (RTM.050727-4200)


    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll


----------------------------------------


System


    Assembly Version: 2.0.0.0


    Win32 Version: 2.0.50727.42 (RTM.050727-4200)


    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll


----------------------------------------


System.Windows.Forms


    Assembly Version: 2.0.0.0


    Win32 Version: 2.0.50727.42 (RTM.050727-4200)


    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll


----------------------------------------


System.Drawing


    Assembly Version: 2.0.0.0


    Win32 Version: 2.0.50727.42 (RTM.050727-4200)


    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll


----------------------------------------


System.Runtime.Remoting


    Assembly Version: 2.0.0.0


    Win32 Version: 2.0.50727.42 (RTM.050727-4200)


    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll


----------------------------------------


JChem


    Assembly Version: 5.3.6.30


    Win32 Version: 5.3.6.30


    CodeBase: file:///C:/Documents%20and%20Settings/grid/Desktop/TestProgram/JChem.DLL


----------------------------------------


IKVM.OpenJDK.Core


    Assembly Version: 0.42.1.51


    Win32 Version: 0.42.1.51


    CodeBase: file:///C:/Documents%20and%20Settings/grid/Desktop/TestProgram/IKVM.OpenJDK.Core.DLL


----------------------------------------


IKVM.OpenJDK.Util


    Assembly Version: 0.42.1.51


    Win32 Version: 0.42.1.51


    CodeBase: file:///C:/Documents%20and%20Settings/grid/Desktop/TestProgram/IKVM.OpenJDK.Util.DLL


----------------------------------------


IKVM.Runtime


    Assembly Version: 0.42.1.51


    Win32 Version: 0.42.1.51


    CodeBase: file:///C:/Documents%20and%20Settings/grid/Desktop/TestProgram/IKVM.Runtime.DLL


----------------------------------------


System.Configuration


    Assembly Version: 2.0.0.0


    Win32 Version: 2.0.50727.42 (RTM.050727-4200)


    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll


----------------------------------------


System.Xml


    Assembly Version: 2.0.0.0


    Win32 Version: 2.0.50727.42 (RTM.050727-4200)


    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll


----------------------------------------


IKVM.OpenJDK.Security


    Assembly Version: 0.42.1.51


    Win32 Version: 0.42.1.51


    CodeBase: file:///C:/Documents%20and%20Settings/grid/Desktop/TestProgram/IKVM.OpenJDK.Security.DLL


----------------------------------------


IKVM.OpenJDK.XML.API


    Assembly Version: 0.42.1.51


    Win32 Version: 0.42.1.51


    CodeBase: file:///C:/Documents%20and%20Settings/grid/Desktop/TestProgram/IKVM.OpenJDK.XML.API.DLL


----------------------------------------


IKVM.OpenJDK.XML.Parse


    Assembly Version: 0.42.1.51


    Win32 Version: 0.42.1.51


    CodeBase: file:///C:/Documents%20and%20Settings/grid/Desktop/TestProgram/IKVM.OpenJDK.XML.Parse.DLL


----------------------------------------


IKVM.OpenJDK.Text


    Assembly Version: 0.42.1.51


    Win32 Version: 0.42.1.51


    CodeBase: file:///C:/Documents%20and%20Settings/grid/Desktop/TestProgram/IKVM.OpenJDK.Text.DLL


----------------------------------------


 


************** JIT Debugging **************


To enable just-in-time (JIT) debugging, the .config file for this


application or computer (machine.config) must have the


jitDebugging value set in the system.windows.forms section.


The application must also be compiled with debugging


enabled.


 


For example:


 


<configuration>


    <system.windows.forms jitDebugging="true" />


</configuration>


 


When JIT debugging is enabled, any unhandled exception


will be sent to the JIT debugger registered on the computer


rather than be handled by this dialog box.


 


ChemAxon b62f37c21a

18-11-2010 08:17:08

Hello,


.NET Framework 2.0 SP2 is required.


Please check that first.


Gabor Vasko

User a8852677c2

18-11-2010 12:04:27

Thanks for your reply,


           Windows SP2 and  .Net framework 2.0 is installed on Virtual Machine as well as base machine.

ChemAxon b62f37c21a

18-11-2010 13:12:35

Not only Windows SP2, but .NET Framework 2.0 SP2.


Please check this: https://www.chemaxon.com/dotNET/install.html


You can also check the registry:



HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727\SP



The value of SP should be 2.


Gabor Vasko

User a8852677c2

19-11-2010 08:45:58

My base machine have


Windows XP SP2 and


.net Framework 2.0


installed on it , given line of code runs properly on base machine.


Virtual machine have same installations then why it throws exception on virtual machine.

ChemAxon bd13b5bd77

19-11-2010 09:35:21

Hi,


please strictly increase the installed framework package to 2.0 SP2 at least or above.


Viktor


 

ChemAxon b62f37c21a

19-11-2010 09:41:56


Dear Yogesh,


I've put the missing magic information in your message:



My base machine have


Windows XP SP2 and


.net Framework 2.0 SP2


installed on it , given line of code runs properly on base machine.


Virtual machine have same installations then why it throws exception on virtual machine.



Gabor Vasko