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.  [ 2 posts ] 
Author Message
 Post subject: Problem parsing configuration - 'log4net' element is not dec
PostPosted: Wed Apr 02, 2008 11:36 am 
Regular
Regular

Joined: Tue Oct 16, 2007 9:45 am
Posts: 93
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
I am getting this message when trying to configure session

NHibernate.HibernateException was caught
Message="problem parsing configuration : System.Xml.Schema.XmlSchemaException: The 'log4net' element is not declared.\r\n at System.Xml.XmlValidatingReaderImpl.InternalValidationCallback(Object sender, ValidationEventArgs e)\r\n at System.Xml.Schema.BaseValidator.SendValidationEvent(XmlSchemaException e, XmlSeverityType severity)\r\n at System.Xml.Schema.BaseValidator.SendValidationEvent(String code, String arg)\r\n at System.Xml.Schema.XsdValidator.ProcessElement(Object particle)\r\n at System.Xml.Schema.XsdValidator.ValidateElement()\r\n at System.Xml.Schema.XsdValidator.Validate()\r\n at System.Xml.XmlValidatingReaderImpl.ProcessCoreReaderEvent()\r\n at System.Xml.XmlValidatingReaderImpl.Read()\r\n at System.Xml.XmlValidatingReader.Read()\r\n at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)\r\n at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)\r\n at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)\r\n at System.Xml.XmlDocument.Load(XmlReader reader)\r\n at NHibernate.Cfg.Configuration.Configure(XmlTextReader reader)"
Source="NHibernate"
StackTrace:
at NHibernate.Cfg.Configuration.Configure(XmlTextReader reader)
at NHibernate.Cfg.Configuration.Configure(String fileName)
at Intelliun.NHibernateExtensions.NHibernateHelper..cctor() in C:\VE4_0\server\namespace\homes\Web\codegen\Demo\NhibernateSessionModule\NHibernateHelper.cs:line 27
InnerException:


Hibernate version: 1.2.1

Mapping documents: App.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate"/>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>

<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<!-- an ISessionFactory instance -->
<session-factory xmlns='urn:nhibernate-configuration-2.2'>
<property name="connection.provider">
NHibernate.Connection.DriverConnectionProvider
</property>
<property name="dialect">
NHibernate.Dialect.MsSql2005Dialect
</property>
<property name="connection.driver_class">
NHibernate.Driver.SqlClientDriver
</property>
<property name="connection.connection_string">
Initial Catalog=AR200;Integrated Security=SSPI
</property>
<!-- uncomment if using with ASP.NET application -->
<property name="hibernate.current_session_context_class">
NHibernate.Context.WebSessionContext, NHibernate
</property>
<property name="show_sql">
true
</property>
<!-- this is not supported yet
<property name="current_session_context_class">
web
</property>-->

<!-- use this setting for any kind of application other then ASP.NET
<property name="current_session_context_class">
call
</property>-->

<!-- mapping files
<mapping resource="Category.hbm.xml" assembly="Intelliun.Domain" />-->
</session-factory>
</hibernate-configuration>

<!-- This section contains the log4net configuration settings -->
<log4net debug="false">

<!-- Define some output appenders -->
<appender name="trace" type="log4net.Appender.TraceAppender, log4net">
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
</layout>
</appender>

<appender name="console" type="log4net.Appender.ConsoleAppender, log4net">
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
</layout>
</appender>

<appender name="rollingFile" type="log4net.Appender.RollingFileAppender,log4net" >

<param name="File" value="log.txt" />
<param name="AppendToFile" value="true" />
<param name="RollingStyle" value="Date" />
<param name="DatePattern" value="yyyy.MM.dd" />
<param name="StaticLogFileName" value="true" />

<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n" />
</layout>
</appender>

<!-- Setup the root category, add the appenders and set the default priority -->

<root>
<priority value="INFO" />
<appender-ref ref="console" />
</root>
</log4net>

</configuration>



Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 02, 2008 4:19 pm 
Regular
Regular

Joined: Tue Oct 16, 2007 9:45 am
Posts: 93
problem solved


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.