[prev in list] [next in list] [prev in thread] [next in thread] 

List:       log4j-user
Subject:    RE: NotSerializableException using log4j
From:       "Ebersole, Steven" <steven.ebersole () vignette ! com>
Date:       2002-08-30 15:51:30
[Download RAW message or body]

Logger, conceptually, should not be Serializable.  

You can mark the Logger fields in those dataObjects as transient, but then
when the session reactivates the field would be null; you'll have to write
logic to handle the session activating to (re)obtain the Logger instance.
This can be done with the javax.servlet.http.HttpSessionActivationListener
interface.

HTH



    |-----Original Message-----
    |From: Denis McCarthy [mailto:dmccarthy@omnipaygroup.com]
    |Sent: Friday, August 30, 2002 10:43 AM
    |To: Log4J Users List
    |Subject: NotSerializableException using log4j
    |
    |
    |Hi there,
    |I'm using log4j in some dataObjects that are stored in 
    |each weblogic session
    |that a user opens. When the server attempts to serialize 
    |the dataObjects in
    |the session, the following error occurs (presumably 
    |because Logger is not
    |serializable)
    |<Error> <HTTP Session> <Could not deserialize session data
    |java.io.NotSerializableException: org.apache.log4j.Logger
    |        at
    |java.io.ObjectOutputStream.outputObject(ObjectOutputStream.
    |java:1148)
    |        at
    |java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)
    |        at
    |java.io.ObjectOutputStream.outputClassFields(ObjectOutputSt
    |ream.java:1827
    |        .
    |        .
    |        .
    |
    |Is there a workaround for this or do I have to take log4j out of my
    |dataObjects? Thanks
    |Denis McCarthy
    |
    |
    |
    |
    |--
    |To unsubscribe, e-mail:   
    |<mailto:log4j-user-unsubscribe@jakarta.apache.org>
    |For additional commands, e-mail: 
    |<mailto:log4j-user-help@jakarta.apache.org>
    |

--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic