ibm-mobilefirstmobilefirst-servermobilefirst-cli

How do I debug MFP JAX-RS adapters when using the CLI?


I am using the MobileFirst CLI to start/stop a development server and push code to it. How do I connect a remote debugger (e.g. IntelliJ) to this server and debug a JAX-RS adapter with it?

Since the CLI does not seem to offer a way of starting the server in debug mode directly, I started the Liberty development server from its home with bin/server debug and was able to connect to it, but breakpoints do not seem to be working.


Solution

  • To connect from IntelliJ to an MFP server started via the CLI with mfp start, select Run>Edit Configurations, Add New Configuration of type Remote and change the port to 10777. When you Run>Debug, you should see Connected to the target VM, address: 'localhost:10777', transport: 'socket' in the Console, and you can now start your debug session. Thanks to @mfunk for figuring it out!

    Tested with IntelliJ 15.0.3 and MFP 7.1.