Use Case: As a developer, I want to do step-by-step debugging of an applicaton running as a pod on the OpenShift cluster using IDE.
Application Debugging is explained in detail in this blogpost. We will cover the required steps shortly in this chapter. Please read the blog at your convenience for detailed overview on debugging using JBDS.
Step 1 Create Server Adapter Server Adapter synchronizes the content between the running application and the workspace.
-
Go to the
OpenShift Explorerview and right click on thewildflyservice and selectServer Adapterto create the server adapter for thewildflyapplication service
-
Next you will see
Server Settingspage. Ensure that theEclipse Project namematches what you see in theProject Explorerview i.e.jboss-as-kitchensinkand pressFinish. You will quickly start seeing Console output that shows the syncup between the pod and the workstation. Once complete you should seewildfly at OpenShifton theServersview.
The Server adapter is now created and ready to use.
Step 2: Set up Server adapter for debugging
- On the
Serversview, right click on thewildfly at OpenShift 3and selectRestart in Debug.
This will stop the current application pod and start a new one with debugging features. It will take a few seconds for it to come up. So, you can observe the pod going down and the new one coming up. When the new pod starts, the Servers view will show that the adapter is running in Debugging mode
- Go to the
OpenShift Explorerview, right click onwildflyservice and selectManage Environment Variables. You can observe that the debug variables are all set automatically.
- Open
MemberRegistration.javain controller from source code and double-click on the line inside theregister()method to insert a breakpoint as shown below.
Now we are ready to start debugging.
Step 3 Start debugging
-
Access the application URL in the browser
-
Add values for
Name,EmailandPhone #and press on theRegisterbutton on the application webpage. -
The control now stops at the breakpoint. You can do step-by-step debugging now.
Once complete, you can switch back to the JBoss perspective. You can also Restart the Server adapter in the normal mode.
Summary: In this chapter we have learnt to debug an application running on OpenShift using IDE.




