首页 新闻 搜索 专区 学院

Nhibernate中的问题

0
[已关闭问题]
我在使用Nhibernate的过程中出现在如下错误:<br><title>The dialect was not set. Set the property hibernate.dialect.</title><style> body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; } </style><span><h2><i>The dialect was not set. Set the property hibernate.dialect.</i> </h2></span><font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "><b>说明: </b>执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 <br><br><b>异常详细信息: </b>NHibernate.HibernateException: The dialect was not set. Set the property hibernate.dialect.</font><br><b>堆栈跟踪:</b> <br><br> <table bgcolor="#ffffcc" width="100%"> <tbody> <tr> <td><code></code><pre>[HibernateException: The dialect was not set. Set the property hibernate.dialect.]<br> NHibernate.Dialect.Dialect.GetDialect() +120<br> NHibernate.Dialect.Dialect.GetDialect(IDictionary props) +133<br> NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc, String name) +57<br><br>[MappingException: Could not compile the mapping document: Model.Person.hbm.xml]<br> NHibernate.Cfg.Configuration.LogAndThrow(MappingException me) +62<br> NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc, String name) +175<br> NHibernate.Cfg.Configuration.AddXmlReader(XmlTextReader hbmReader, String name) +65<br> NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream, String name) +149<br> NHibernate.Cfg.Configuration.AddResource(String path, Assembly assembly) +234<br> NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly, Boolean skipOrdering) +314<br> NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly) +36<br> NHibernate.Cfg.Configuration.AddAssembly(String assemblyName) +182<br> NHibernate.Helper.SessionFactory.OpenSession() in E:\C#练习\NHB_Model\NHibernate.Helper\NHibernateModule.cs:36<br> NHibernateOperation.NHibernateModule.EntityControl`1..ctor() in E:\C#练习\NHB_Model\NHibernateOperation\EntityControl.cs:35<br> NHibernateOperation.NHibernateModule.CommonDatabaseOperation`1.GetEntityControl() in E:\C#练习\NHB_Model\NHibernateOperation\CommonDatabaseOperation.cs:58<br> WebDAL.PersonOperation..ctor() in E:\C#练习\NHB_Model\WebDAL\DAL.cs:13<br> _Default.Page_Load(Object sender, EventArgs e) in e:\C#练习\NHibernateWeb\Default.aspx.cs:15<br> System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +31<br> System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +68<br> System.Web.UI.Control.OnLoad(EventArgs e) +88<br> System.Web.UI.Control.LoadRecursive() +74<br> System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3035<br></pre></td></tr></tbody></table><br>
问题补充: 看了好久不知道错在哪里,在我的hibernate.cfg.xml中有dialect这个节点,请高手指点!! hibernate.cfg.xml: <?xml version="1.0" encoding="utf-8" ?> <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" > <session-factory name="NHibernate.Test" > <!-- properties --> <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property> <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property> <property name="show_sql">false</property> <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property> <property name="use_outer_join">true</property> <property name="use_proxy_validator">true</property> <!--<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>--> <!-- mapping files --> <!--<mapping assembly ="" />--> </session-factory> </hibernate-configuration> 连接字符串和实体类程序集在程序中添加。
伽马科技.攻城师的主页 伽马科技.攻城师 | 小虾三级 | 园豆:1303
提问于:2008-08-20 16:39
< >
分享
其他回答(3)
0
把你的配置文件贴出来看看。
TerryLee | 园豆:3300 (老鸟四级) | 2008-08-20 18:19
0
log4net的日志也搞上来看看 另外这边也有错: [MappingException: Could not compile the mapping document: Model.Person.hbm.xml]
玛瑙王国--这里的玛瑙会说话 | 园豆:258 (菜鸟二级) | 2008-08-20 22:25
0
The dialect was not set. Set the property hibernate.dialect. 从异常的信息来看,你应该这么配置 <property name="hibernate.dialect">NHibernate.Dialect.MsSql2005Dialect</property> 用hibernate.dialect代替dialect
Gray Zhang | 园豆:17610 (专家六级) | 2008-08-20 23:45
0
Nhibernate 还不会呢。
金色海洋(jyk) | 园豆:290 (菜鸟二级) | 2008-08-23 09:03
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册