I just started running this problem through my head this morning. I'd be happy to write it.
On Fri, 16 Nov 2001, Ceki Gulcu wrote: > > Hello, > > Anyone interested in adding version support for LoggingEvent serialization? >Currently, the sending side and the receiving side of a LoggingEvent have to have the >same fields. If a field is added or if a field is removed in LoggingEvent from one >log4j version to the next, if the log4j versions do not match, then serialization >does not work. > > It would be useful if we could gracefully handle *some* changes in LoggingEvent. >This is quite a nice software engineering problem. Regards, Ceki > > At 10:02 16.11.2001 -0600, [EMAIL PROTECTED] wrote: > >Scott: > > > >After I cleaned up log4j version on both send and receive sides, the > >problem automatically disappears. Obviously, the difference of log4j > >versions causes the server side classloader failure of loading log4j. I > >actually packaged the log4j and my publisher into an EJB. Thank you for > >your advice very much. > > > >Qin > > > > > > > > Scott Coleman > > <scott.coleman@so To: 'Log4J Developers List' ><[EMAIL PROTECTED]> > > ltima.com> cc: > > Subject: RE: Question about the >properties file. Please Help. > > 11/15/01 01:49 AM > > Please respond to > > Log4J Developers > > List > > > > > > > > > > > > > >I would have thought that point 2, below is the problem. > >You can TEST this by putting log4j.jar in the classpath of weblogic, by > >modifying the start script. Then every ejb will be able to load log4j > >classes. is that you do not have log4j.jar in the classpath of weblogic. > >If > >this works then you need to decide whether you wish to have hot deploy > >functionality of log4j, is you do you must package it (i think) with your > >ejb. > > > >Regards > >Scott > > > >-----Original Message----- > >From: Ceki Gulcu [mailto:[EMAIL PROTECTED]] > >Sent: Wednesday, November 14, 2001 11:51 PM > >To: Log4J Developers List > >Subject: Re: Question about the properties file. Please Help. > > > > > > > >Hello, > > > >LoggingEvent is serializable. It has been seralizable and serialized for a > >long time. > >There are two possible reasons for your problem: > > > >1) You are not using the same log4j version on sender side and the MDB > >side. > > > >2) log4j.jar and consequently org.apache.log4j.spi.LoggingEvent is not > >accessible by your MDB. > > > >Hope this helps, Ceki > > > >At 16:14 14.11.2001 -0600, you wrote: > >>Hi, Ceki: > >> > >>I wrap the log4j into an EJB and config it to use JMSAppender to > >publish > >>logging message to the JMS server on Weblogic 6.1. And I wrote a > >>MessageDrivenBean (MDB) to consume the message by writing the msg to our > >>database. > >> > >>When the JMS server receives Message with ObjectMessage in it, it delivers > >>the Message to my MDB by calling the MDB's onMessage method. When I tried > >>to retrieve the the LoggingEvent from the ObjectMessage, I receive an > >error > >>message stating "Error: deserializing object". > >> > >>This is what I try to do: > >> > >>try { > >> ObjectMessage om = (ObjectMessage)message; ------------ successful > >> LoggingEvent msg = (LoggingEvent) om.getObject(); ------------ failed > >> String strTokens = (String) msg.getMessage(); ------------- > >>never get in here > >>} > >>catch(JMSException jmse) > >>{ > >> jmse.printStackTrace(); > >>} > >> > >>I checked the MDB spec, that ObjectMessage's getObject() returns > >>java.io.Serializable. LogggingEvent is Serializable class. I don't know > >>why it can't be casted to LoggingEvent. > >> > >>I wonder is it because LoggingEvent constructor carries a param message > >>which is the type of Object. Object itself is not Serializable. Also, an > >>instance variable of LoggingEvent is transient Object message. So, this > >>message cannot be serialized due to the key word trancient. getMessage() > >>method returns Object message instead of Serializable. Do you think these > >>may cause the deserialization problem I have experienced? If yes, how can > >>I work around this? If I change Object to Serializable, then I have to > >>change not only LoggingEvent class but Category class as well? Please > >>advise. Thank you very much. > >> > >>Qin > >> > >> > >>-- > >>To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > >>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > > > > >-- > >To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > >For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > > >-- > >To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > >For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > > > > > > > > >-- > >To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > >For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > ------------------------------------------------------------------- Who owns your data? Proprietary protocols and file formats are dangerous. ------------------------------------------------------------------- -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>