Configuring Eclipse for Remote Debugging
Pages: 1, 2, 3, 4, 5, 6, 7, 8

In the Debug Configuration frame, specify a name for the debug configuration. Select the project that is to be debugged, namely the EclipseJBoss project previously created in the Eclipse IDE. Select the default value for Connection Type. In the Connection Properties, specify localhost as the Host and specify the Port as the port that was specified in the run batch script of the JBoss server, 8787. Click on the Apply button to add the remote Java application debug configuration, as shown in Figure 13.

JBoss debug configuration
Figure 13. JBoss debug configuration

Next, add exception breakpoints to the JBossServlet.java file. Earlier, we added a NullPointerException to JBossServlet. To add a breakpoint to the servlet class, select Run -> Add Java Exception Breakpoint, as shown in Figure 14.

Adding Java exception breakpoint
Figure 14. Adding Java exception breakpoint

In the Add Java Exception Breakpoint frame, select the NullPointerException, as shown in Figure 15. The NullPointerException breakpoint gets added to the servlet class.

NullPointerException breakpoint
Figure 15. NullPointerException breakpoint

If a NullPointerException is generated in the servlet application in the JBoss server, the application gets suspended and the Debug perspective of the Eclipse IDE displays the exception.

Pages: 1, 2, 3, 4, 5, 6, 7, 8

Next Pagearrow