ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | architecture List | October 2004 Index

<--  Date Index  --> <--  Thread Index  -->

Re: [architecture] ClassCastException in log4j.MonologLoggerFactory.getLogger


Hi,

It is a logging confiuration problem. I suggest you to do:
1/ adding the following line in the log4j.properties:
log4j.categoryFactory=org.objectweb.util.monolog.wrapper.log4j.MonologCategoryFactory

2/ integrating the ow_monolog.jar into the apps server classpath. You
could find the library, in the 'lib' directory of the monolog
distribution:
http://download.forge.objectweb.org/monolog/Monolog_1.8_bin.zip

details:
The use of Monolog over log4j requires to specify to log4j, the logger
factory provided by Monolog. We could not remove this requirement
without decreasing efficency of getLogger(String) method.

Best regards,
Seb

Le mer 20/10/2004 à 14:34, gerald Quintana a écrit :
> Hello,
> 
> I am trying to send messages to a Joram server from a session bean
> located in JBoss. JBoss 4.0 uses Log4J 1.2.8 for logging. 
> 
> When I access to Joram JNDI registry from my Session bean I get a 
> ClassCastException:
> Caused by: java.lang.ExceptionInInitializerError
> at 
> fr.dyade.aaa.jndi2.client.NamingContextFactory.getInitialContext(NamingContextFactory.java:57)
> at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
> at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
> at javax.naming.InitialContext.init(InitialContext.java:219)
> at javax.naming.InitialContext.<init>(InitialContext.java:195)
> at MySessionBean.sendDirectMessage(MySessionBean.java:129)
> (...)
> Caused by: java.lang.ClassCastException
> at 
> org.objectweb.util.monolog.wrapper.log4j.MonologLoggerFactory.getLogger(MonologLoggerFactory.java:205)
> at fr.dyade.aaa.util.Debug.getLogger(Debug.java:139)
> at fr.dyade.aaa.jndi2.client.Trace.<clinit>(Trace.java:34)
>  .. 46 more
> 
> I have found in this mailing list archives that I should add 
> log4j.loggerFactory=org.objectweb.util.monolog.wrapper.log4j.MonologCategoryFactory
> in the log4j configuration file, so I added a 
> <categoryFactory 
> class="org.objectweb.util.monolog.wrapper.log4j.MonologCategoryFactory"/> 
> tag in the log4j.xml of JBoss, but I still get a ClassCastException.
> 
> I replaced Joram's Monolog Jar(release 1.7.2) by the newest one: 1.8 but it 
> doesn't help either, still the same ClassCastException as above.
> 
> What can I do?
> Gerald
> 
> 
> PS: Here is my Monolog configuration file a3debug.cfg:
> log.config.classname 
> org.objectweb.util.monolog.wrapper.log4j.MonologLoggerFactory
> handler.tty.type Console
> handler.tty.output System.out
> handler.tty.pattern  %d : %O{1}.%M : %m%n
> logger.fr.dyade.aaa.handler.0 tty
> logger.fr.dyade.aaa.level ERROR
> logger.org.objectweb.joram.handler.0 tty
> logger.org.objectweb.joram.level ERRORnull
> 
> Forfait AOL ADSL 5 Méga à 22.90EUR/mois
> 
> 
> ______________________________________________________________________
-- 
Sebastien Chassande-Barrioz
Research & Development Engineer
France Telecom, Research & Development, MAPS/AMS laboratory
28 chemin du Vieux Chene - B.P. 98
38243 Meylan CEDEX - France
phone: +33.4.76.76.42.10 - fax: +33.4.76.76.45.57
email: sebastien.chassandebarrioz@xxxxxxxxxxxxxxxxxxxx
email: sebastien.chassande-barrioz@xxxxxxxxxx
GSM: 06.73.16.09.32

Try our JDO product: http://speedo.objectweb.org




<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.