Mail Archive Home | architecture List | October 2004 Index
| <-- Date Index --> | <-- Thread Index --> |
Hi Sebastien,
I found the solution by myself, but I had to add logs in monolog. In fact I
had
- one ow_monolog.jar in the JBoss lib folder
- another ow_monolog.jar in my J2EE app folder
When JBoss starts, it initializes the loggers with its class loader. Then
when my app was getting a logger, the instance was a logger from JBoss class
loader but it could not be casted in the logger interface which was my app
class loader.
The solution was to remove the ow_monolog.jar in my J2EE app folder and keep
only one monolog Jar for the whole JBoss.
Thanks for your help,
Gerald
> De: Sebastien Chassande-Barrioz
> <sebastien.chassandebarrioz@xxxxxxxxxxxxxxxxxxxx>
> A: gerald Quintana <gerald.quintana@xxxxxxxxxxxx>
> Objet: Re: [architecture] ClassCastException in
> log4j.MonologLoggerFactory.getLogger
> Date: Thu, 21 Oct 2004 08:55:36 +0200
> 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:
> <A HREF="http://download.forge.VOIDweb.org/monolog/Monolog_1.8_bin.zip"
> TARGET="_blank">http://download.forge.objectweb.org/monolog/Monolog_1.8_bin.zip</A>
>
> 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: <A HREF="http://speedo.VOIDweb.org"
> TARGET="_blank">http://speedo.objectweb.org</A>null
Forfait AOL ADSL 5 Méga à 22.90EUR/mois
| <-- Date Index --> | <-- Thread Index --> |
Powered by MHonArc.
Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.