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: Configuration for 2.0
PostPosted: Mon Oct 20, 2008 9:18 am 
Beginner
Beginner

Joined: Fri Feb 29, 2008 9:36 am
Posts: 40
Hi,

After migration to NHibernate 2.0, I have another problem.


Code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <configSections>

    <section name="log4net"
      type="log4net.Config.Log4NetConfigurationSectionHandler,
            log4net"
    />

    <!-- NHibernate Section -->
    <section
        name="hibernate-configuration"
        type="NHibernate.Cfg.ConfigurationSectionHandler,NHibernate"
        />

    <sectionGroup name="applicationSettings"
...
    </sectionGroup>

  </configSections>

  <log4net>

    <!-- A1 is set to be a ConsoleAppender -->
    <appender name="A1" type="log4net.Appender.ConsoleAppender, log4net">
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%-4timestamp [%thread] %-5level %logger %ndc - %message%newline" />
      </layout>
    </appender>

    <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender, log4net">
      <file value="logs/log4net.log" />
      <appendToFile value="true" />
      <rollingStyle value="Size" />
      <maxSizeRollBackups value="10" />
      <maximumFileSize value="100KB" />
      <staticLogFileName value="true" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%-4timestamp [%thread] %-5level %logger %ndc - %message%newline" />
      </layout>
    </appender>

    <!-- Set root logger level to DEBUG and its only appender to A1 -->
    <root>
      <level value="ALL" />
      <appender-ref ref="A1"/>
      <appender-ref ref="RollingFileAppender"/>
    </root>

  </log4net>

  <!-- NHibernate Configuration -->
  <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
  </hibernate-configuration>

  <applicationSettings>
...
  </applicationSettings>

</configuration>



On the next line

Code:
NHibernate.Cfg.Configuration config = new NHibernate.Cfg.Configuration();


I get an error

Une exception a été levée par l'initialiseur de type pour 'NHibernate.Cfg.Environment'.


Can you help me to correct my config please ?

Papy


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.