These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: TypeInitializationException, Configuration
PostPosted: Fri Oct 13, 2006 10:30 am 
Newbie

Joined: Fri Oct 13, 2006 10:11 am
Posts: 3
Hi!

I get the exception below when the following statement is executed:
Code:
Configuration cfg = new Configuration();


No matter what NHibernate version. I tried it on two computers (both have .net 1.1 AND .net 2.0 installed). I'm using .net 2.0 for development.

Any hints? I browsed the web, the forum and the newgroups for the exception TypeInitializationException together with NHibernate and the Configuration, but couldn't find anything.

This exception even occurrs when executing unmodified examples from e.g. code-project.

Thanks in advance for your help!

Hibernate version: 1.0.2 & 1.2.0 b1

Mapping documents: as embedded source.
Content:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
   <class name="Glasses.Test.PcvUsers,Glasses" table="pcv_users">
      <id name="Id" column="id" type="Guid">
         <generator class="assigned"/>
      </id>
      <property column="username" type="String" name="Username" not-null="true" length="64" />
      <property column="password" type="String" name="Password" length="64" />
      <property column="realname" type="String" name="Realname" length="255" />
      <property column="is_active" type="Boolean" name="IsActive" not-null="true" />
      
   </class>
</hibernate-mapping>


Code between sessionFactory.openSession() and session.close(): The error occurrs before a session can be created.

Full stack trace of any exception that occurs:
Code:
System.TypeInitializationException was unhandled
  Message="The type initializer for 'NHibernate.Cfg.Configuration' threw an exception."
  Source="Glasses"
  TypeName="NHibernate.Cfg.Configuration"
  StackTrace:
       at Glasses.Test.PcvUsers.Add(PcvUsers user, String& msg) in J:\programming\VS.net\test ground\NHibernateExample\Glasses\PcvUsers.cs:line 173
       at Glasses.Test.Form1.button1_Click(Object sender, EventArgs e) in J:\programming\VS.net\test ground\NHibernateExample\GlassesClient\Form1.cs:line 25
       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.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at Glasses.Test.Program.Main() in J:\programming\VS.net\test ground\NHibernateExample\GlassesClient\Program.cs:line 17
       at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.