org.apache.activemq.SERIALIZABLE_PACKAGES property affecting Map Messages

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

org.apache.activemq.SERIALIZABLE_PACKAGES property affecting Map Messages

khandelwalanuj
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
Reply | Threaded
Open this post in threaded view
|

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

khandelwalanuj
This post was updated on .
Ok. I am able to make it work by adding "org" in the serializable package
property.

Details:
Not working with:  -Dorg.apache.activemq.SERIALIZABLE_PACKAGES=java,com.test,test,local"

Working with: -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
Reply | Threaded
Open this post in threaded view
|

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

Tim Bain
Try org.apache.activemq, since that's where MapMessage lives.

On Oct 11, 2017 12:47 AM, "khandelwalanuj" <[hidden email]>
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
>
Reply | Threaded
Open this post in threaded view
|

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

khandelwalanuj
> 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
Reply | Threaded
Open this post in threaded view
|

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

khandelwalanuj
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
Reply | Threaded
Open this post in threaded view
|

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

Tim Bain
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 <
[hidden email]> 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
>