Proper way to get response with cometd java client in rc0.

10 views
Skip to first unread message

Thorbjørn Ravn Andersen

unread,
Sep 28, 2009, 3:29:30 PM9/28/09
to cometd-users
I have a situation where I would like to push Java objects serialized
to XML across a cometd channel between two Java instances.

I have tried stripping the chat demo down to a simple program with a
MessageListener subscribing to a channel, and a sender routine. I
put the above XML string in a map and publish it. I get a map up in
the MessageLIstener with the proper key, but the value contains <
&gt; and &amp; instead of < > and &. This naturally causes the XML
deserialization to fail.

The full description with code snippets is on
http://stackoverflow.com/questions/1487126/proper-way-to-decode-response-in-dojo-cometd-java-client

I would like to know if I found a bug in the Java client or if I am
intended to decode the <, > and &'s myself? The libraries used is the
rc0 distribution.

Please advise,

/Thorbjørn

Simone Bordet

unread,
Sep 29, 2009, 5:52:54 AM9/29/09
to cometd...@googlegroups.com
Hi,

2009/9/28 Thorbjørn Ravn Andersen <thorb...@gmail.com>:

Please check that you're not using json filters: check for
WEB-INF/filters.json that does a bunch of default conversions, among
which the NoMarkupFilter.

Simon
--
http://bordet.blogspot.com
---
Finally, no matter how good the architecture and design are,
to deliver bug-free software with optimal performance and reliability,
the implementation technique must be flawless. Victoria Livschitz

Thorbjørn Ravn Andersen

unread,
Oct 1, 2009, 2:19:42 AM10/1/09
to cometd-users


On 29 Sep., 11:52, Simone Bordet <simone.bor...@gmail.com> wrote:
> Hi,
>
> 2009/9/28 Thorbjørn Ravn Andersen <thorbjo...@gmail.com>:
>
>
>
>
>
> > I have a situation where I would like to push Java objects serialized
> > to XML across a cometd channel between two Java instances.
>
> > I have tried stripping the chat demo down to a simple program with a
> > MessageListener subscribing to a channel, and a  sender routine.  I
> > put the above XML string in a map and publish it.  I get a map up in
> > the MessageLIstener with the proper key, but the value contains &lt;
> > &gt; and &amp; instead of < > and &.  This naturally causes the XML
> > deserialization to fail.
>
> > The full description with code snippets is on
> >http://stackoverflow.com/questions/1487126/proper-way-to-decode-respo...
>
> > I would like to know if I found a bug in the Java client or if I am
> > intended to decode the <, > and &'s myself?  The libraries used is the
> > rc0 distribution.
>
> Please check that you're not using json filters: check for
> WEB-INF/filters.json that does a bunch of default conversions, among
> which the NoMarkupFilter.

It turned out I was not talking to the cometd web application I
thought I was, but to an earlier deployment of the chat room demo
server war, and _that_ used the NoMarkupFilter. Bummer :)

Thank you! That was a great help.

/Thorbjørn
Reply all
Reply to author
Forward
0 new messages