ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Rosjava fails to build when custom messages are listed as a dependency

asked 2012-02-23 09:46:24 -0500

Joe gravatar image

updated 2012-02-23 09:46:39 -0500


Currently, I have a package containing all of my custom messages called "OryxMessages". This builds fine, and other packages can use these messages. A few weeks ago, my rosjava package had no problem generating the proper files for these messages building. Today, however, I removed 1 of the messages from that package and rebuilt it. Everything works fine, except now my rosjava package won't build, giving me the following error:

      [javac] Compiling 4 source files to /home/oryx/.ros/rosjava/build/OryxMessages
      [javac] javac: invalid flag: -g:${debuglevel}
      [javac] Usage: javac <options> <source files>
      [javac] use -help for a list of possible options

  /home/oryx/ros_workspace/rosjava_core/rosjava_bootstrap/scripts/build-msg.xml:72: Compile failed; see the compiler error output for details.

  Total time: 1 second
  Traceback (most recent call last):
    File "/home/oryx/ros_workspace/rosjava_core/rosjava_bootstrap/src/main/python/rosjava_bootstrap/", line 108, in <module>
    File "/home/oryx/ros_workspace/rosjava_core/rosjava_bootstrap/src/main/python/rosjava_bootstrap/", line 100, in main
      build(rospack, package)
    File "/home/oryx/ros_workspace/rosjava_core/rosjava_bootstrap/src/main/python/rosjava_bootstrap/", line 70, in build
    File "/home/oryx/ros_workspace/rosjava_core/rosjava_bootstrap/src/main/python/rosjava_bootstrap/", line 214, in generate_msg_depends
      _generate_msgs(rospack, p, up_to_date)
    File "/home/oryx/ros_workspace/rosjava_core/rosjava_bootstrap/src/main/python/rosjava_bootstrap/", line 198, in _generate_msgs
    File "/home/oryx/ros_workspace/rosjava_core/rosjava_bootstrap/src/main/python/rosjava_bootstrap/", line 111, in run_ant
    File "/usr/lib/python2.7/", line 504, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['ant', '-f', '/home/oryx/ros_workspace/rosjava_core/rosjava_bootstrap/scripts/build-msg.xml', u'-Dproperties=/home/oryx/.ros/rosjava/properties/', 'maven-install']' returned non-zero exit status 1

I am not sure what could be causing it. To verify that it wasn't a code problem, I removed all dependencies except rosjava and built it. Like expected, it built fine. When I added in OryxMessages as a dependency, it once again failed to compile. Again, I am confused at what happened because it was working before I removed the one message.

Thank you,

-Joseph Amato

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2012-03-05 07:10:29 -0500

damonkohler gravatar image

Try running the logged ant command yourself and inspect the error message for debugging clues. Clearing out .ros/rosjava is also a good step.

If you can put together a small example project that reproduces this issue reliably, please post an issue:

edit flag offensive delete link more

answered 2012-02-25 06:05:17 -0500

ahendrix gravatar image

The rosjava build system isn't particularly robust. Try clearing out your rosjava build directory ( rm -r ~/.ros/rosjava ) and rebuilding.

edit flag offensive delete link more


Unfortunately, clearing out the directory does not help. In fact, after deleting the ~/.ros/rosjava directory, the included rosjava pubsub tutorial no longer builds with the same error. It seems as though a recent update causes the build process to fail if messages have not already been generated.

Joe gravatar image Joe  ( 2012-02-26 06:32:06 -0500 )edit

Question Tools



Asked: 2012-02-23 09:46:24 -0500

Seen: 523 times

Last updated: Mar 05 '12