You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by mjustin <mi...@gmx.net> on 2008/03/24 10:27:04 UTC

jms-json transformation: missing library

Dear all,

with the current 5.1 snapshot, jms-json transformation requires the
Thoughtworks xstream library which is not included in the binary
distribution. 

I have found a download location for the required jars:
http://dist.codehaus.org/com.thoughtworks.xstream/jars/


If the jar can not be included for license reasons, maybe this info could be
added to the relevant pages (for example on
http://activemq.apache.org/stomp.html)

Best Regards
Michael Justin

-- 
View this message in context: http://www.nabble.com/jms-json-transformation%3A-missing-library-tp16247478s2354p16247478.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: jms-json transformation: missing library

Posted by mjustin <mi...@gmx.net>.
Found it :)

The message was sent as a JMS BytesMessage (instead of a TextMessage) and
the object property names have to be in lowercase. I am more than happy now
=)

Kind Regards
Michael Justin


mjustin wrote:
> 
> The Delphi-generated version does not show up as SamplePojo object in the
> admin console. This means that Java clients could not receive the objects
> which have been JSON-encoded by Delphi ...
> 

-- 
View this message in context: http://www.nabble.com/jms-json-transformation%3A-missing-library-tp16247478s2354p16258141.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: jms-json transformation: missing library

Posted by mjustin <mi...@gmx.net>.
Hi Dejan,

meanwhile I found out how a JSON-encoded java  object encodes the class
name.
Now I can see that I can generate JSON-encoded objects with Java and Delphi,
the differences are very small. Only the order of the fields changes:

Generated by the Java producer:
{"SamplePojo":{"name":"myname ...","id":"myId ..."}}

Generated by Delphi:
{"SamplePojo":{"id":"myid ...","name":"myname ..."}}

The Delphi-generated version does not show up as SamplePojo object in the
admin console. This means that Java clients could not receive the objects
which have been JSON-encoded by Delphi ...
I will investigate more and see if I can find something. (UTF8 encoding and
decoding is enabled and checked).

Best Regards
Michael Justin



mjustin wrote:
> 
> Then I tried to send a JSON encoded object from Delphi which has the
> 'transformation' property set to 'jms-json'. The message appears but no
> object is shown in the message view. 
> 
> This is no surprise because JSON does not know anything about classes, it
> is just a data exchange format.
> 
> Now the question: is it possible to send a JSON encoded object to ActiveMQ
> so that it will be mapped to the SamplePojo class (given that the JSON
> object contains values for the the pojo properties)?
> 

-- 
View this message in context: http://www.nabble.com/jms-json-transformation%3A-missing-library-tp16247478s2354p16257756.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: jms-json transformation: missing library

Posted by mjustin <mi...@gmx.net>.
Hello Dejan,

many thanks - it works like a charm now. 

Now I am stuck just at the next corner and could have know before:

I wrote a SamplePojo class and send it from a Java producer tool, and it
successfully shows up in the web admin console. It appears in the typical
Java notation in the 'Message Details' field: SamplePojo@e3f6d.

Then I tried to send a JSON encoded object from Delphi which has the
'transformation' property set to 'jms-json'. The message appears but no
object is shown in the message view. 

This is no surprise because JSON does not know anything about classes, it is
just a data exchange format.

Now the question: is it possible to send a JSON encoded object to ActiveMQ
so that it will be mapped to the SamplePojo class (given that the JSON
object contains values for the the pojo properties)?

Or should I better use jms-xml and SOAP serialization for mixed programming
languages?

Best Regards

Michael Justin





Dejan Bosanac wrote:
> 
> Hi Michael,
> 
> you are right, XStream is an optional dependency, so you have to put
> it manually into the lib/ folder. Additionally, you have to include
> jettison (http://jettison.codehaus.org) into broker's classpath if you
> plan to use JSON. I've just updated docs with this info
> (http://cwiki.apache.org/confluence/display/ACTIVEMQ/Stomp).
> 

-- 
View this message in context: http://www.nabble.com/jms-json-transformation%3A-missing-library-tp16247478s2354p16256382.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: jms-json transformation: missing library

Posted by Dejan Bosanac <de...@nighttale.net>.
Hi Michael,

you are right, XStream is an optional dependency, so you have to put
it manually into the lib/ folder. Additionally, you have to include
jettison (http://jettison.codehaus.org) into broker's classpath if you
plan to use JSON. I've just updated docs with this info
(http://cwiki.apache.org/confluence/display/ACTIVEMQ/Stomp).

Thanks
-- 
Dejan Bosanac
www.scriptinginjava.net

On Mon, Mar 24, 2008 at 10:27 AM, mjustin <mi...@gmx.net> wrote:
>
>  Dear all,
>
>  with the current 5.1 snapshot, jms-json transformation requires the
>  Thoughtworks xstream library which is not included in the binary
>  distribution.
>
>  I have found a download location for the required jars:
>  http://dist.codehaus.org/com.thoughtworks.xstream/jars/
>
>
>  If the jar can not be included for license reasons, maybe this info could be
>  added to the relevant pages (for example on
>  http://activemq.apache.org/stomp.html)
>
>  Best Regards
>  Michael Justin
>
>  --
>  View this message in context: http://www.nabble.com/jms-json-transformation%3A-missing-library-tp16247478s2354p16247478.html
>  Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>