[jdom-interest] Messaging: JMS Unable to Serialize Document

James Strachan james at metastuff.com
Wed Oct 18 02:28:33 PDT 2000


If you're using JMS and MQSeries to send around an XML message, I'd strongly
advise you to use the textual form to send the message rather than use Java
Serialisation.

I'd recommend using use either a JMS TextMessage or StreamMessage and store
the textual form of the JDOM tree in that.
Then other MQSeries clients can parse your message using any language they
want. Even if all your MQSeries clients are Java they may want to use
different versions of Java or JDOM or other XML parsing libraries to read
the data (e.g. SAX).

One of XML's great strengths is as an on-the-wire format. One of JDOM's
great strengths is as an in-memory Java represetnation of an XML document.
Always try to use the best tool for the job.


J.

James Strachan
=============
email: james at metastuff.com
web: http://www.metastuff.com
----- Original Message -----
From: "Steve Morris" <steve.morris at nwa.com>
To: <jdom-interest at jdom.org>
Cc: "Susan Sjoblom" <susan.sjoblom at nwa.com>
Sent: Tuesday, October 17, 2000 9:57 PM
Subject: [jdom-interest] Messaging: JMS Unable to Serialize Document


> I'm having difficulty sending JDOM XML Documents to MQSeries queues via
Java
> Messaging Service (JMS).
>
> I have a javax.jms.ObjectMessage defined as...
>
> > ObjectMessage myMessage;
>
> When I try to call the its setObject method, providing my JDOM Document as
> the argument...
>
> > myMessage.setObject(myDocument);
>
> JMS throws the following....
>
> > javax.jms.MessageFormatException:
> > MQJMS1060: Unable to serialize object
>
> Here's a link to the javax.jms.ObjectMessage where
> setObject(java.io.Serializable object) is defined...
>
> >
http://java.sun.com/products/jms/javadoc-102a/javax/jms/ObjectMessage.html
>
>
> Doesn't org.jdom.Document implement serializable?
> When I send other types of Objects such as...
>
> > String myString = "A String in an Object";
>
> > myMessage.setObject(myString);
>
> it works ok.
>
> What am I missing?
>
>
> Steviemo
>
> _______________________________________________
> To control your jdom-interest membership:
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com
>


If you are not the addressee of this confidential e-mail and any
attachments, please delete it and inform the sender; unauthorised
redistribution or publication is prohibited. Views expressed are those of
the author and do not necessarily represent those of Citria Limited.



More information about the jdom-interest mailing list