You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by khandelwalanuj <an...@gmail.com> on 2017/10/11 06:24:58 UTC

org.apache.activemq.SERIALIZABLE_PACKAGES property affecting Map Messages

Hi,

I am using ActiveMQv5.14.5 and observing below mentioned behavior with
ActiveMQ. 

We have a use case where python producer using stomp send json data({'P1':
False, 'end_date': '20170911'}) to Java Consmer where Java Consumer expect
to receive it as jms MapMessage.

When I run ActiveMQ broker with
"org.apache.activemq.SERIALIZABLE_PACKAGES=*", the workflow works fine and
consumer is able to receive message.

However we I specify some specific package which are used 
"org.apache.activemq.SERIALIZABLE_PACKAGES=java,com.test,test,local" I
receive the same message as JMS TextMessage. And received text message
contents are : 

producer side message: {'P1': False, 'end_date': '20170911'}
Consumer side received text message:
<map>
<entry><string>P1</string><string>False</string></entry>
<entry><string>end_date</string><string>20170911</string></entry>
</map>

I have no idea why this property which is supposed to be used for
ObejctMessages is affecting this workflow. This sounds like a bug. Any help
would be appreciated. 

Thanks,
Anuj





--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: org.apache.activemq.SERIALIZABLE_PACKAGES property affecting Map Messages

Posted by Tim Bain <tb...@alumni.duke.edu>.
The default value of that property (if it's not set) is
"java.lang,javax.security,java.util,org.apache.activemq,org.fusesource.hawtbuf,com.thoughtworks.xstream.mapper"
(see ClassLoadingAwareObjectInputStream.java), and the
org.fusesource.hawtbuf class in question looks like a UTF8Buffer since
that's referenced in the switch statements in ActiveMQMapMessage.java.

I don't see any immediate reason why that property would come into play for
MapMessages, but I don't know this code well. Maybe you could set
breakpoints on ClassLoadingAwareObjectInputStream's constructor and on its
checkSecurity() method to see when/why they get called?

Tim

On Fri, Oct 13, 2017 at 9:23 AM, khandelwalanuj <
anuj.cool.khandelwal@gmail.com> wrote:

> Can someone check this please.
>
> I just wanted to know which library from "org." is being used here for MAP
> messages as mentioned above.
>
>
>
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-
> f2341805.html
>

Re: org.apache.activemq.SERIALIZABLE_PACKAGES property affecting Map Messages

Posted by khandelwalanuj <an...@gmail.com>.
Can someone check this please.

I just wanted to know which library from "org." is being used here for MAP
messages as mentioned above. 



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: org.apache.activemq.SERIALIZABLE_PACKAGES property affecting Map Messages

Posted by khandelwalanuj <an...@gmail.com>.
> Try org.apache.activemq, since that's where MapMessage lives. 
Nope. doesn't work with "org.apache.activemq" or "org.apache". 

It only works with "org"





--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html

Re: org.apache.activemq.SERIALIZABLE_PACKAGES property affecting Map Messages

Posted by Tim Bain <tb...@alumni.duke.edu>.
Try org.apache.activemq, since that's where MapMessage lives.

On Oct 11, 2017 12:47 AM, "khandelwalanuj" <an...@gmail.com>
wrote:

> Ok. I am able to make it work by adding "org" in the serializable package
> property.
>
> Details:
>
> -Dorg.apache.activemq.SERIALIZABLE_PACKAGES=java,*
> org*,com.test,test,local"
>
> Can anyone explain what exact package I need to add to make it work as
> "org"
> is huge ? Also shouldn't these packages be taken care by ActiveMQ itself
> rather thn specifying as a property ?
>
>
> Thanks,
> Anuj
>
>
>
> --
> Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-
> f2341805.html
>

Re: org.apache.activemq.SERIALIZABLE_PACKAGES property affecting Map Messages

Posted by khandelwalanuj <an...@gmail.com>.
Ok. I am able to make it work by adding "org" in the serializable package
property. 

Details:

-Dorg.apache.activemq.SERIALIZABLE_PACKAGES=java,*org*,com.test,test,local"

Can anyone explain what exact package I need to add to make it work as "org"
is huge ? Also shouldn't these packages be taken care by ActiveMQ itself
rather thn specifying as a property ?


Thanks,
Anuj



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html