db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Mahler <thm...@web.de>
Subject Re: chicken and egg
Date Thu, 12 Feb 2004 07:09:14 GMT
Hi Andy,

The idea of a BootLogger is meant to avoid the chicken and egg problem. 
The Bootlogger can be used in situation where no Configuration is yet 
available during the boot phase.

If the LoggerFactory tries to load the Configuration somewhere in the 
sequence of serving the bootlogger this is definitely a bug as it 
compromises the safety of the bootlogger mechanism!

So we should verify and fix it asap.

Thomas

Andy Malakov wrote:
> Hello All,
> 
> Logger needs Configuration (during initialization), Configuration also needs Logger (if
any errors come up during configuration retrieval).
> 
> LoggerFactoryImpl.getLogger() uses OjbConfigurator.getInstance() which 
> 
> a) OjbConfigurator has static initializer Logger log = LoggerFactory.getBootLogger();
> b) OjbConfigurator creates instance of OjbConfiguration which also has static initializizer
logger = LoggerFactory.getBootLogger();
> 
> It doesn't result in infinite loop since initializers are executed only once, but result
in NullPointerException:
> 
> java.lang.NullPointerException
>  at org.apache.ojb.broker.util.logging.LoggerFactoryImpl.getLogger(LoggerFactoryImpl.java:173)
>  at org.apache.ojb.broker.util.logging.LoggerFactory.getLogger(LoggerFactory.java:103)
>  at org.apache.ojb.broker.accesslayer.IndirectionHandler.<clinit>(IndirectionHandler.java:86)
>  at java.lang.Class.forName0(Native Method)
>  at java.lang.Class.forName(Class.java:141)
>  ...
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message