Note that there are some explanatory texts on larger screens.

plurals
  1. POC# mvc2 nhibernate problem
    primarykey
    data
    text
    <p>I've got the following mapping in my application. The mapping is generated, by a custom tool. Other mappings generated work ok, but this one is giving me a strange error which I don't understand.</p> <p>This is the mapping;</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;!--Generated by NHibernate.Mapping.Attributes on 2010-10-29 08:39:48Z.--&gt; &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"&gt; &lt;class name="Plugin.Twitter.Business.Entities.Tweet, Plugin.Twitter" table="PluginTwitter_Tweet"&gt; &lt;id name="Id" column="Id"&gt; &lt;generator class="guid" /&gt; &lt;/id&gt; &lt;property name="TweetMessage" /&gt; &lt;property name="TweetDate" /&gt; &lt;property name="TweetId" /&gt; &lt;/class&gt; &lt;/hibernate-mapping&gt; </code></pre> <p>This is the error which i'm getting in the browser when i trying to open the website containing the mapping file; <img src="https://i.stack.imgur.com/7NbeM.png" alt="Mapping Error"></p> <p>The stacktrace with it is as below;</p> <pre><code>[InvalidOperationException: Could not find the dialect in the configuration] NHibernate.Dialect.Dialect.GetDialect(IDictionary 2 props) +204 NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc) +155 [MappingException: Could not compile the mapping document: Plugin.Twitter.Business.Entities.Hbm.Tweet.hbm.xml] NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc) +534 NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream, String name) +378 NHibernate.Cfg.Configuration.AddResource(String path, Assembly assembly) +419 NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly) +355 NHibernate.Cfg.Configuration.AddAssembly(String assemblyName) +291 CMS.ResourceAccess.DataAccessLogic.SessionManagement.SessionManager..ctor() in C:\Projects\Website\Website.ResourceAccess\DataAccessLogic\SessionManagement\SessionManager.cs:73 Website.ResourceAccess.DataAccessLogic.SessionManagement.NestedSessionManager..cctor() in C:\Projects\Website\Website.ResourceAccess\DataAccessLogic\SessionManagement\SessionManager.cs:90 [TypeInitializationException: The type initializer for 'NestedSessionManager' threw an exception.] Website.ResourceAccess.DataAccessLogic.SessionManagement.SessionManager.get_Instance() in C:\Projects\Website\Website.ResourceAccess\DataAccessLogic\SessionManagement\SessionManager.cs:39 CMS.ResourceAccess.DataAccessLogic.SessionManagement.SessionManager.get_SessionFactory() in C:\Projects\Website\Website.ResourceAccess\DataAccessLogic\SessionManagement\SessionManager.cs:23 Website.Backend.MvcApplication.StartNHibernateSession() in C:\Projects\Website\Website.Web\Global.asax.cs:82 Website.Backend.MvcApplication.Application_Start() in C:\Projects\Website\Website.Web\Global.asax.cs:47 [HttpException (0x80004005): The type initializer for 'NestedSessionManager' threw an exception.] System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +3988565 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +191 System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +325 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +407 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +375 [HttpException (0x80004005): The type initializer for 'NestedSessionManager' threw an exception.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11529072 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4784373 </code></pre> <p>I think the import thing to notice is that the exception i'm getting is an mapping exception as shown with this rule;</p> <pre><code>MappingException: Could not compile the mapping document: Plugin.Twitter.Business.Entities.Hbm.Tweet.hbm.xml] </code></pre> <p>I don't understand how and why though so I hope someone can tell me what the error means and how I can fix this issue. I've got the mapping marked as embedded resource.</p> <p>UPDATE: We're using the following hibernate.cfg.xml file in the application.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;hibernate-configuration xmlns='urn:nhibernate-configuration-2.2'&gt; &lt;session-factory&gt; &lt;property name="show_sql"&gt;true&lt;/property&gt; &lt;property name="dialect"&gt;NHibernate.Dialect.MsSql2008Dialect&lt;/property&gt; &lt;property name="connection.driver_class"&gt;NHibernate.Driver.SqlClientDriver&lt;/property&gt; &lt;property name="connection.connection_string_name"&gt;NHibernate&lt;/property&gt; &lt;property name="current_session_context_class"&gt;managed_web&lt;/property&gt; &lt;property name='proxyfactory.factory_class'&gt;NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu&lt;/property&gt; &lt;!--Needed for NH Profiler--&gt; &lt;property name="generate_statistics"&gt;false&lt;/property&gt; &lt;/session-factory&gt; &lt;/hibernate-configuration&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload