Wednesday, May 26, 2010

Remote Debugging Java packages in WSO2 Carbon using IntelliJ IDEA


Here I'm going to tell you an easy way of debugging java packages deployed under any WSO2 product. So, you don't need to go wondering and go through thousands of lines looking what the bug was in your package.
What you need:
  • IntelliJ IDEA
Thats it. Now, open your Java package/bundle from IDEA.
Then, go to Run -> Edit Configurations
Add a remote debug configuration by clicking on '+' sign (at top left corner) and then remote.
It comes with a default set of settings. Keep them intact. get to know the port number(generally it's 5005)


Now, start the WSO2 Product you are using with the parameter of debug followed by the port number.
sh wso2server.sh debug 5005

It waits and listens on port 5005 until remote debugging client is started. Start the client by, (in IDEA)
Run -> Debug
All done. Now you can do normal debugging by putting break-points in your .java files.

That's how I got it done. Does this help you to succeed in remote debugging?