When you write a lot of add-ons for IBM Rhapsody, it becomes very helpful to be able to debug them. This can be a little more difficult when they're running inside the Rhapsody processes, rather than as an external Java application. There are lots of reasons for running in process though, not least because they run an order of magnitude faster, and you can tie them to a profile that adds things like menu commands and properties to control it. In this video I show how it's possible to debug them as remote java applications enabling you to set breakpoints and step through the code in Eclipse, even though the code is running in Rhapsody. You first need to add some changes to your Rhapsody ini file though. The video illustrates. Hopefully, it helps someone out there. p.s. This is a real life example.
The JVM section is where the Java Virtual Machine that Rhapsody will use is specified.
I've added the Debug1, Debug2 and Debug3 options to my .ini file before, hence I just need to include them in Options list for the JVM.
Now when I run Rhapsody and an attempt is made to load a plugin into the Rhapsody JVM, it will wait for a remote debug connection.
To get the Eclipse debugger to connect we need to run a Remote Java Application configuration and change the port number for the Remote Java Application to 6743.
Voilà, the debugger connects with the waiting plugin running in the Rhapsody JVM.
It's now possible to run the application as normal, but set breakpoints in the plugin code. E.g., I'll set a breakpoint in the Java plugin.
To reload the plugin code, I need to exit Rhapsody not just close the project.
Doh!! (an unnecessary space, but I can fix it)
Hope that helps. Interested in MBSE/UML or Rhapsody training or customizations then email me.
Post a Comment
Note: only a member of this blog may post a comment.