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.  [ 3 posts ] 
Author Message
 Post subject: {"Could not compile the mapping document: Misc.Case.hbm
PostPosted: Tue Jul 17, 2007 1:07 am 
Newbie

Joined: Mon Jul 16, 2007 9:39 am
Posts: 4
Hibernate version: Runtime v2.0.50727 /Version 1.2.0.4000

Mapping documents:

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="Ingenix.HCRM.Framework.BE"
assembly="Misc">
<class name="Case" table="CM_Cases">
<id name="CaseID">
<generator class="assigned" />
</id>
<property name="CaseGroupID"/>
<property name="CaseDesc"/>
<property name="CaseDate" type="DateTime"/>
</class>
</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():
public ISession OpenSession()
{
ISessionFactory factory;

Configure();

factory = config.BuildSessionFactory();
return factory.OpenSession();
}

private void Configure()
{
config = new Configuration();
IDictionary props = new Hashtable();

props["hibernate.connection.provider"] = "NHibernate.Connection.DriverConnectionProvider";
props["hibernate.dialect"] = "NHibernate.Dialect.MsSql2005Dialect, NHibernate.with2005Dialect";
props["hibernate.connection.driver_class"] = "NHibernate.Driver.SqlClientDriver";
props["hibernate.connection.connection_string"] = "Server=PCID12761;initial catalog=Northwind;User Id=sa;Password=password;";

foreach (DictionaryEntry de in props)
{
config.SetProperty(de.Key.ToString(), de.Value.ToString());
}

Assembly assembly = Assembly.Load(MappingsAssembly);
foreach (string file in MappingFiles)
{
config.AddResource(MappingsAssembly + "." + file, assembly);
}
}
Full stack trace of any exception that occurs:
Inner Exception : {"Could not load file or assembly 'NHibernate.with2005Dialect' or one of its dependencies. The system cannot find the file specified.":"NHibernate.with2005Dialect"}
Message: "Could not instantiate dialect class NHibernate.Dialect.MsSql2005Dialect, NHibernate.with2005Dialect"
StackTrace:" at NHibernate.Dialect.Dialect.InstantiateDialect(String dialectName)\r\n at NHibernate.Dialect.Dialect.GetDialect(IDictionary props)\r\n at NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc, String name)"
StackTrace: " at NHibernate.Cfg.Configuration.LogAndThrow(MappingException me)\r\n at NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc, String name)\r\n at NHibernate.Cfg.Configuration.AddXmlReader(XmlTextReader hbmReader, String name)\r\n at NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream, String name)\r\n at NHibernate.Cfg.Configuration.AddResource(String path, Assembly assembly)\r\n at Ingenix.HCRM.Framework.ObjectManager.Configure() in D:\\Sudhagar\\Misc\\ObjectManager.cs:line 62\r\n at Ingenix.HCRM.Framework.ObjectManager.OpenSession() in D:\\Sudhagar\\Misc\\ObjectManager.cs:line 70\r\n at Ingenix.HCRM.Framework.DAL.CaseFactory..ctor() in D:\\Sudhagar\\Misc\\CaseFactory.cs:line 55\r\n at Misc.Form1.button1_Click(Object sender, EventArgs e) in D:\\Sudhagar\\Misc\\Form1.cs:line 25\r\n at System.Windows.Forms.Control.OnClick(EventArgs e)\r\n at System.Windows.Forms.Button.OnClick(EventArgs e)\r\n at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)\r\n at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)\r\n at System.Windows.Forms.Control.WndProc(Message& m)\r\n at System.Windows.Forms.ButtonBase.WndProc(Message& m)\r\n at System.Windows.Forms.Button.WndProc(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)\r\n at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n at System.Windows.Forms.Application.Run(Form mainForm)\r\n at Misc.Program.Main() in D:\\Sudhagar\\Misc\\Program.cs:line 17\r\n at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)\r\n at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.ThreadHelper.ThreadStart()"

Name and version of the database you are using:
SQL2005

The generated SQL (show_sql=true):


Hi these are the enough information i have captured .

Really thank you all for your time and consideration.

Cheers
Sudhagar.S


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 17, 2007 4:30 am 
Beginner
Beginner

Joined: Wed Nov 29, 2006 10:32 am
Posts: 34
AFAIK, starting with NHib 1.2 the MsSql2005Dialect is in the NHibernate DLL. So, the second line of you props assignments should be:

props["hibernate.dialect"] = "NHibernate.Dialect.MsSql2005Dialect, NHibernate";

(without the "with2005Dialect").

Regards
Harald


Top
 Profile  
 
 Post subject: Thanks.
PostPosted: Tue Jul 17, 2007 8:49 pm 
Newbie

Joined: Mon Jul 16, 2007 9:39 am
Posts: 4
Thanks dude. After removing that, still i was facing problem. But I was using SERVER NAME for my SQLSERVER2005. Rather using that i tryed with my SERVER IP, which workout. And I am able to by pass that Error.

Do you any idea on this? Share with me.

Thanks for timely support.
Cheers
Sudhagar.S


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

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.