Ceki,

Thank very much responding. I have looked at SocketAppender and JMSAppender.
If I understood them correctly, They are not relevent for us. I may be
wrong.

We have an existing system which already uses JMS. We put ObjectMessages on
Queue.  Some QueueListeners in a pool pick the messages and process them
asynchronously.  When QueueListener is processing the message, I want to
restore NDC to NDC at message creation time.  NDC are assigned for a Execute
Thread. Since QueueListeners are running in a different Thread on the same
machine,  We loose NDC. To restore NDC in a different Thread, I am putting
NDC Stack in ObjectMessage.  When message is popped by QueueListener from
the Queue,  It can use NDC stack on the message to restore NDC.  

Please let me know if we can do this with SocketAppender or JMSAppender. Any
other suggestions are also appreciated.

Sarat


-----Original Message-----
From: Ceki Gülcü [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 23, 2001 11:23 AM
To: LOG4J Users Mailing List" <[EMAIL PROTECTED]>
Subject: RE: Trying to serialize NDC Stack



Sarat,

NDC's are converted to a string before being sent on the wire. The NDC is
not lost it is just converted. Can you see anything wrong with that? Have
looked at SocketAppender and JMSAppender deal with remote logging? Ceki

At 10:50 23.02.2001 -0500, Sarat Para wrote:
>I have fixed this problem by making DiagnosticContext (inner class in NDC)
>serializable.  Just added implements serializable to the class definition.
>No other code changes.  With this change Stack returned from
>NDC.cloneStack() is serializable.  So we can use it restore NDC later.  
>
>Looks like this change does not have any other side effects.  Is it
possible
>to include this in next release of Log4J? Please let me know if some one
>feels other wise.
>
>Please reply with your comments.
>
>Sarat
>
>
>-----Original Message-----
>From: Sarat Para [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, February 22, 2001 11:28 AM
>To: [EMAIL PROTECTED]
>Subject: Trying to serialize NDC Stack
>
>
>I trying to put NDC stack in a JMS ObjectMessage and restore NDC when the
>message is popped from Queue.  I am getting following Exception.  I am
using
>weblogic 5.1 with jdk1.3.  
>
>My guess is this problem is due to the fact that DiagnosticContext (inner
>class in NDC) that is pushed on to NDC stack is not serializable.  Is there
>any reason NDC and DiagnosticContext can not  be serializable??
>
>Please let me know if I am missing some thing here.
>
>Sarat
>
>
>javax.jms.JMSException: setObject: problem serializing copy
>        at
>weblogic.jms.common.ObjectMessageImpl.setObject(ObjectMessageImpl.jav
>a:65)
>        at
>weblogic.jms.client.JMSSession.createObjectMessage(JMSSession.java:13
>3)
>        at com.air2web.platform.core.queue.Queues.putI(Queues.java:162)
>        at com.air2web.platform.core.queue.Queues.put(Queues.java:101)
>        at
>com.air2web.platform.core.messagedelivery.SMTPMessage.send(SMTPMessag
>e.java:79)
>        at
>com.air2web.platform.wirelet.PublishDataWirelet.service(PublishDataWi
>relet.java:223)
>        at
>com.air2web.platform.markup.wirelet.WireletContextImpl.invokeWirelet(
>WireletContextImpl.java:72)
>        at
>com.air2web.platform.markup.wirelet.WireletContainer.dispatch(Wirelet
>Container.java:105)
>        at
>com.air2web.platform.markup.ScriptController.processConversation(Scri
>ptController.java:641)
>        at
>com.air2web.platform.conversation.ConversationManager.startConversati
>on(ConversationManager.java:124)
>        at
>com.air2web.platform.device.protocol.http.handler.ApiRequestHandler.n
>otify(ApiRequestHandler.java:97)
>        at
>com.air2web.platform.device.protocol.http.HttpProtoManager.service(Ht
>tpProtoManager.java:82)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>        at
>weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
>pl.java:123)
>        at
>weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
>textImpl.java:761)
>        at
>weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
>textImpl.java:708)
>        at
>weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
>ContextManager.java:252)
>        at
>weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
>a:346)
>        at
>weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:246)
>        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:135)
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]

----
Ceki Gülcü          Web:   http://qos.ch      
av. de Rumine 5     email: [EMAIL PROTECTED] (preferred)
CH-1005 Lausanne           [EMAIL PROTECTED]
Switzerland         Tel: ++41 21 351 23 15


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to