PDA

View Full Version : spring container loopless


pmcmaia
09-12-2005, 10:38 PM
Hi all!

Excuse my bad english.

I have a have 2 objects in a file "common-app-context.xml".

<objects xmlns="http://www.springframework.net">
<object id="FmC_Core" type="Spring.Objects.Factory.Config.Log4NetFactoryObject , Spring.Core">
<property name="LogName" value="FmC.Core"/>
</object>

<object id="FmC_Xls_GlobalShort" type="SIGD_SGPS_SOA.Reports.IoC.Xls_GlobalShort, SIGD_SGPS_SOA.Reports.Ws" lazy-init="true">
</object>

</objects>


with this configuration the startup container do a loopless that never ends.
If a remove the second object, the spring container startup without problems. If i put the lazy-init="true" flag in the second object the container startup without problems, and evrey thinks work fine.

Whats wrong ?

where is my app.config:

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

<configSections>
<!--
<section name="log4net" type="System.Configuration.IgnoreSectionHandler" />
-->
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>

<log4net>

<appender name="RollingFile_FmC" type="log4net.Appender.RollingFileAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%d [%t] %-5p %c{1} - %m%n" />
</layout>
<file value="C:/Inetpub/wwwroot/log/core-fmc-services.log" />
<appendToFile value="true" />
<maximumFileSize value="500KB"/>
<maxSizeRollBackups value="5"/>
</appender>


<appender name="RollingFile_Spring" type="log4net.Appender.RollingFileAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%d [%t] %-5p %c{1} - %m%n" />
</layout>
<file value="C:/Inetpub/wwwroot/log/core-spring-services.log" />
<appendToFile value="true" />
<maximumFileSize value="500KB"/>
<maxSizeRollBackups value="5"/>
</appender>

<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%d [%t] %-5p %c{1} - %m%n" />
</layout>
</appender>

<root>
<level value="OFF"/>
</root>

<logger name="FmC.Core">
<level value="DEBUG"/>
<appender-ref ref="RollingFile_FmC"/>
<appender-ref ref="ConsoleAppender"/>
</logger>

<logger name="Spring">
<level value="DEBUG" />
<appender-ref ref="RollingFile_Spring"/>
<appender-ref ref="ConsoleAppender"/>
</logger>
</log4net>

</configuration>



Thanks.

Rick Evans
09-15-2005, 02:27 PM
Hi

If possible, can you post the class definition of your Xls_GlobalShort class? Possibly even just the definition of the no-arg constructor.

I'm convinced that the issue is with your code, and not the container, and certainly not the Log4NetFactoryObject (http://www.springframework.net/doc/api/html/Spring.Objects.Factory.Config.Log4NetFactoryObject .html) (it is a simple shim) or any of the Log4NET configuration.

Sorry, I don't mean to sound abrupt, but I have replicated your issue in my own stub project that I use for testing answers to forum posts prior to posting and have no issue at all. The answer must like with the class definition of the Xls_GlobalShort class (and specifically in its no-arg constructor, or in the initialisation of its static fields, or perhaps the Xls_GlobalShort class implements some of the Spring.NET callback interfaces such as IObjectFactoryAware (http://www.springframework.net/doc/api/html/Spring.Objects.Factory.IObjectFactoryAware.html)). Please do post your code... if you have any issues regarding posting your code to a public forum, you can always email me directly (my email is attached to the bottom of this post).

While we are here, what is with the plain bizarre naming convention you seem to have with your namespaces and class names? 'SIGD_SGPS_SOA.Reports.IoC.Xls_GlobalShort, SIGD_SGPS_SOA.Reports.Ws' is quite an agonizing class name to read... I'm just interested thats all :D

Cheerio
Rick

pmcmaia
10-07-2005, 12:36 AM
Hi,

I have done a reengineer to the project and the problem has gone, i suspect of the circularity of the log4net.

Thanks, anyway.