-->
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.  [ 4 posts ] 
Author Message
 Post subject: hibernate.connection.driver_class error
PostPosted: Tue Nov 28, 2006 2:50 am 
Newbie

Joined: Tue Nov 28, 2006 2:23 am
Posts: 7
I'm new to NHibernate and am trying to build a simple app that uses NHibernate to store presist information to a SQL database. I'm using Visual Web Developer 2005 Express Edition. When I run the program I get the following error:

NHibernate.HibernateException: The hibernate.connection.driver_class must be specified in the NHibernate configuration section.
at NHibernate.Connection.ConnectionProvider.ConfigureDriver(IDictionary settings)
at NHibernate.Connection.UserSuppliedConnectionProvider.Configure(IDictionary settings)
at NHibernate.Connection.ConnectionProviderFactory.NewConnectionProvider(IDictionary settings)
at NHibernate.Cfg.SettingsFactory.BuildSettings(IDictionary properties)
at NHibernate.Cfg.Configuration.BuildSettings()
at NHibernate.Cfg.Configuration.BuildSessionFactory()

my hibernate.cfg.xml file is located in the Bin dictory and looks like:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section
name="nhibernate"
type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
/>
</configSections>

<nhibernate>
<add
key="hibernate.connection.provider"
value="NHibernate.Connection.DriverConnectionProvider"
/>
<add
key="hibernate.dialect"
value="NHibernate.Dialect.MsSql2000Dialect"
/>
<add
key="nhibernate.connection.driver_class"
value="NHibernate.Driver.SqlClientDriver"
/>
<add
key="hibernate.connection.connection_string"
value="[...]"
/>
</nhibernate>
</configuration>

Any and all ideas are welcome. Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 28, 2006 3:02 am 
Expert
Expert

Joined: Thu Jan 19, 2006 4:29 pm
Posts: 348
You have nhibernate.connection.driver_class in config. Remove the leading "n"

Gert

_________________
If a reply helps You, rate it!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 28, 2006 11:46 am 
Newbie

Joined: Tue Nov 28, 2006 2:23 am
Posts: 7
thanks for the reply, but I'm still having problems. I added the following lines to my code-behind:

cfg.AddFile(Server.MapPath("~/Person.hbm.xml"));
cfg.Configure(Server.MapPath("~/Bin/hibernate.cfg.xml"));

that took care of the driver_class problem but now I'm getting:

NHibernate.MappingException: The dialect was not set. Set the property hibernate.dialect. ---> NHibernate.HibernateException: The dialect was not set. Set the property hibernate.dialect.
at NHibernate.Dialect.Dialect.GetDialect()
at NHibernate.Dialect.Dialect.GetDialect(IDictionary props)
at NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc)
at NHibernate.Cfg.Configuration.AddXmlReader(XmlTextReader hbmReader)
at NHibernate.Cfg.Configuration.AddXmlFile(String xmlFile)
--- End of inner exception stack trace ---
at NHibernate.Cfg.Configuration.AddXmlFile(String xmlFile)
at NHibernate.Cfg.Configuration.AddFile(String xmlFile)

the only thing I've changed in my config file is hibernate.connection.driver_class (used to have nhibernate.....). Everything else in the config file is the same as above.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 28, 2006 6:58 pm 
Newbie

Joined: Tue Nov 28, 2006 2:23 am
Posts: 7
My Professor and I spent about an hour messing with the code until it worked. In the end we just started over, so problem solved. Thanks for the help.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.