Rosanswers logo

I have created a talker in in rosjava and have created a listener in C++ code. When I run the talker and the start the listener I see this on the talker screen...

May 11, 2012 2:53:01 PM org.jboss.netty.channel.DefaultChannelPipeline WARNING: An exception was thrown by a user handler while handling an exception event ([id: 0x4b3ec2dd, / :> /] EXCEPTION: java.lang.IllegalStateException: Unexpected message MD5 fee433c609b213f85c484ba6dc0f8c7c != 74765c06a94b3265f1c21e7d818205cd) org.ros.exception.RosRuntimeException: java.lang.IllegalStateException: Unexpected message MD5 fee433c609b213f85c484ba6dc0f8c7c != 74765c06a94b3265f1c21e7d818205cd at org.ros.internal.transport.ConnectionTrackingHandler.exceptionCaught(ConnectionTrackingHandler.java:73) at org.jboss.netty.channel.Channels.fireExceptionCaught(Channels.java:432) at org.jboss.netty.channel.AbstractChannelSink.exceptionCaught(AbstractChannelSink.java:52) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:302) at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:317) at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:299) at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:216) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274) at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261) at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:349) at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:280) at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:200) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:679) Caused by: java.lang.IllegalStateException: Unexpected message MD5 fee433c609b213f85c484ba6dc0f8c7c != 74765c06a94b3265f1c21e7d818205cd at com.google.common.base.Preconditions.checkState(Preconditions.java:145) at org.ros.internal.node.topic.DefaultPublisher.finishHandshake(DefaultPublisher.java:179) at org.ros.internal.transport.tcp.TcpServerHandshakeHandler.handleSubscriberHandshake(TcpServerHandshakeHandler.java:99) at org.ros.internal.transport.tcp.TcpServerHandshakeHandler.messageReceived(TcpServerHandshakeHandler.java:69) ... 12 more

I know that the talker and listener are working correctly all in rosjava but when I try to connect it with C++ node I get this error. Roscore is running on localhost:11311. What am I missing here? It also fails when I do a rostopic echo chatter.


Originally posted by mikegulf on ROS Answers with karma: 56 on 2012-05-11

Post score: 2

Original comments

Comment by joq on 2012-05-11:
Looks like the message checksums do not match. What message are you trying to send?

Comment by mikegulf on 2012-05-11:
I tried doing custom messages at first but then checked by sending a string and it did the same thing.


1 Answer 1


Rosanswers logo

The message means that the Rosjava publisher is trying to publish a message to a topic on which the C++ listener already listens, but the publisher's message type doesn't match the subscriber's message type. This can have two reasons:

  1. Publisher and subscriber use different message types (e.g., one uses std_msgs/String and the other std_msgs/Int8).

  2. Both use the same message type, but were built with different versions of it.

To debug (1), you can do the following:

  • start a new roscore (!)
  • start the subscriber
  • do a rosnode info on the subscriber
  • repeat the same for the publisher (after restarting the roscore) and see whether subscription and publication match up

To debug (2), you can

  • make sure that your ROS_PACKAGE_PATH and ROS_ROOT are set up correctly
  • rebuild your message package, if you are using custom messages
  • rebuild your subscriber and your publisher (that way you know that both used the same environment variables when they were build)

I don't have any experience with the newest rosjava build system using gradle, but before the switch to gradle, it usually also helped to do the following, then rebuild the rosjava nodes:

rm -rf ~/.m2/ ~/.ros/rosjava/
(cd $(rosstack find rosjava_core) && hg clean --all)

Originally posted by Martin Günther with karma: 11816 on 2012-05-13

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by mikegulf on 2012-05-17:
Thanks for the tips. It turned out I was sending one type of message and wanting to receive a different one. Once I got things aligned and was sending the proper message I was good. I appreciate your help.

Comment by Martin Günther on 2012-05-21:
Glad to help! Please mark the answer as correct (check box to the left).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.