NHibernate.HibernateException: Could not instantiate dialect class

553 views
Skip to first unread message

RobertSt...@gmail.com

unread,
Jul 16, 2008, 8:23:19 AM7/16/08
to nhusers
I have no idea what this means. Could somebody please help me.

The full error as logged is:

ERROR 4 NHibernate.Cfg.Configuration - Could not compile the mapping
document: Credentials.hbm.xml
NHibernate.MappingException: Could not compile the mapping document:
Credentials.hbm.xml ---> NHibernate.HibernateException: Could not
instantiate dialect class ---> System.NullReferenceException: Object
reference not set to an instance of an object.
at NHibernate.Util.TypeNameParser.ParseTypeName(String text, String
defaultNamespace, String defaultAssembly)
at NHibernate.Dialect.Dialect.InstantiateDialect(String
dialectName)
--- End of inner exception stack trace ---
at NHibernate.Dialect.Dialect.InstantiateDialect(String
dialectName)
at NHibernate.Dialect.Dialect.GetDialect()
at NHibernate.Dialect.Dialect.GetDialect(IDictionary props)
at
NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument
doc)
--- End of inner exception stack trace ---

The mapping document in question is:

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="AgCg.Core.Authentication.Service.Credentials,
AgCg.Core" table="credentials">
<id name="id" access="field" type="Int32" column="ID">
<generator class="native" />
</id>
<property name="name" access="field" column="Name" />
<property name="signature" access="field" column="Signature" />
</class>
</hibernate-mapping>

Thanks,

Robert

Jozef Sevcik

unread,
Jul 16, 2008, 8:37:09 AM7/16/08
to nhu...@googlegroups.com
Show your hibernate.cfg.xml, seems that is source of exception.




--
S pozdravom / Best regards,

Jozef Ševčík
sev...@styxys.com

+420 608 782 813
+420 222 364 769

RobertSt...@gmail.com

unread,
Jul 16, 2008, 9:30:41 PM7/16/08
to nhusers
I am using the NHibernateFacility from Castle. The configuration is
as follows:

<facility
id="nhibernatefacility"

type="Castle.Facilities.NHibernateIntegration.NHibernateFacility,
Castle.Facilities.NHibernateIntegration"
isWeb="true">

<factory id="sessionFactory1">
<settings>

<item
key="hibernate.connection.provider">NHibernate.Connection.DriverConnectionProvider</
item>
<item
key="hibernate.connection.driver_class">NHibernate.Driver.MySqlDataDriver</
item>
<item
key="hibernate.connection.connection_string">Server=localhost;Database=Demo;User
ID=root;Password=</item>
<item
key="hibernate.dialect">NHibernate.Dialect.MySQL5Dialect</item>

<!--<item
key="hibernate.search.default.directory_provider">NHibernate.Search.Storage.FSDirectoryProvider,
NHibernate.Search</item>
<item
key="hibernate.search.default.indexBase">~</item>
<item
key="hibernate.query.substitutions">true=1;false=0</item>-->

</settings>
<assemblies>
<assembly>AgCg.Core</assembly>
<assembly>AgCg.ContentManagement</assembly>
</assemblies>
</factory>

</facility>

On Jul 16, 7:37 am, "Jozef Sevcik" <sev...@styxys.com> wrote:
> Show your hibernate.cfg.xml, seems that is source of exception.
>
> 2008/7/16 RobertStackho...@gmail.com <RobertStackho...@gmail.com>:

Markus Zywitza

unread,
Jul 17, 2008, 3:54:41 AM7/17/08
to nhu...@googlegroups.com
If you use Castle trunk, its NH2.x and you have to leave out the
leading "hibernate." in the item keys.

-Markus

RobertSt...@gmail.com

unread,
Jul 17, 2008, 4:17:07 PM7/17/08
to nhusers
Thanks. I just switched from NH 1.x to NH2.x, and I wasn't aware of
the change in the name of these configuration properties.

On Jul 17, 2:54 am, "Markus Zywitza" <markus.zywi...@gmail.com> wrote:
> If you use Castle trunk, its NH2.x and you have to leave out the
> leading "hibernate." in the item keys.
>
> -Markus
>
Reply all
Reply to author
Forward
0 new messages