-->
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.  [ 1 post ] 
Author Message
 Post subject: hibernate-configuration section not found in application
PostPosted: Fri Sep 26, 2008 8:22 am 
Newbie

Joined: Fri Sep 26, 2008 3:38 am
Posts: 1
Location: Althengstett (Germany)
Hibernate version: NHibernate 2.0.0.4000 (2.0.0.4000)

Hi,

following problem:

add the properties in a hashtable
Code:
                        propsRet["Environment.ConnectionProvider"] = "NHibernate.Connection.DriverConnectionProvider";
                        propsRet["Environment.Dialect"] = "NHibernate.Dialect.MySQL5Dialect";
                        propsRet["Environment.ConnectionDriver"] = "NHibernate.Driver.MySqlDataDriver";
                        propsRet["Environment.ConnectionString"] = "Server=" + iniServer + ";Database = " + iniDatabase + ";user id=" + iniUser + "; password=" + iniPasswort + "; port=" + iniPort;
                        propsRet["Environment.CommandTimeout"] = "5000";


build configuration and set properties
Code:
                cfgTemp = new Configuration();
                foreach (DictionaryEntry de in propsTemp)
                {
                    cfgTemp.SetProperty(de.Key.ToString(), de.Value.ToString());
                }

                // This Assembly allways
                cfgTemp.AddAssembly("BaseLib");


When "AddAssembly" i have this error:

Code:
2008-09-26 13:43:59,124 [1] ERROR NHibernate.Cfg.Configuration [(null)] [LogAndThrow] - Could not compile the mapping document: BaseLib.Server.DataBase.SystemTable.Mapping.BaseMenuItemInfo.hbm.xml
NHibernate.MappingException: Could not compile the mapping document: BaseLib.Server.DataBase.SystemTable.Mapping.BaseMenuItemInfo.hbm.xml ---> System.InvalidOperationException: Could not find the dialect in the configuration
   bei NHibernate.Dialect.Dialect.GetDialect(IDictionary`2 props)
   bei NHibernate.Cfg.Configuration.AddValidatedDocument(NamedXmlDocument doc)


Mapping XML:

Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
   <class name="SWP.FWK.Server.DataBase.SystemTable.BaseMenuItemInfo, BaseLib" table="menustructure">
      <id name="ID" unsaved-value="0">
         <column name="id" sql-type="bigint" not-null="true" unique="true" index="PRIMARY"/>
         <generator class="native">
            <param name="sequence">id_sequence</param>
         </generator>
      </id>
      <property name="MenuType">
         <column name="menuType" sql-type="smallint" not-null="true"/>
      </property>
      <property name="MenuStructure">
         <column name="menuStructure" length="30" sql-type="varchar" not-null="true"/>
      </property>
      <property name="ModulPgm">
         <column name="modulPgm" sql-type="smallint" not-null="true"/>
      </property>
      <property name="ModPgmNumber">
         <column name="modPgmNumber" sql-type="int" not-null="true"/>
      </property>
      <property name="DemoPoint">
         <column name="demoPoint" sql-type="tinyint" not-null="true"/>
      </property>
      <property name="Createuser">
         <column name="createuser" length="10" sql-type="varchar" not-null="true"/>
      </property>
      <property name="Createdate">
         <column name="createdate" sql-type="date" not-null="true"/>
      </property>
      <property name="Changeuser">
         <column name="changeuser" length="10" sql-type="varchar" not-null="true"/>
      </property>
      <property name="Changedate">
         <column name="changedate" sql-type="timestamp" not-null="true"/>
      </property>
   </class>
</hibernate-mapping>


The earlier Version 1.2 runs without problems

ThankĀ“s for help

_________________
alea iacta est


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

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.