[jgroups-users] v3->v4 move, problem with castMessage
Questions/problems related to using JGroups <[email protected]> Thu, 26 Oct 2017 14:13:44 -0400
| Newsgroups | gmane.comp.java.javagroups.general |
|---|---|
| Message-ID | <mailman.18761.1509043541.12861.javagroups-users@lists.sourceforge.net> |
Hi again,
Am having various problems with our v3->v4 change. Trying to focus on them
one at a time, I wanted to ask about the castMessage change. We were doing
this before to send a message out to every node, collect responses, etc:
RspList<MyOb> rspList = md.castMessage(null,
new Message(null, myString), ro);
...where myString is actually a constant starting with "n" and MyOb is a
Serializable object with some primitive data in it and one Address object
(*).
Now trying in v4.0.7 with this:
RspList<MyOb> rspList = md.castMessage(null,
Util.stringToBytes(myString),
0, myString.length(), ro);
...but my Rsp (only 1 node so far) comes back with an exception instead of
MyOb:
"java.lang.IllegalArgumentException: type 110 is invalid" (110 is the first
byte in the array).
I see that my handle() method is being called at the receiving end, and the
exception happens when I call Message#getObject() -- that code hasn't
changed from 3.x:
@Override
public Object handle(Message msg) throws Exception {
final Object payload = msg.getObject();
<etc>
}
The getObject eventually calls Util#objectFromByteBuffer, and that method
is treating the first byte of the message as the type of the message, and
it falls apart there.
Is there some other way I should be handling this?
(*) Related: am getting a lot of FindBugs warnings now because we have a
couple Serializable objects we pass around that include Address objects,
and that isn't marked Externalizable any more. Any advice there would also
be appreciated.
Thanks,
Bobby
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
javagroups-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/javagroups-users