Configuring Eclipse for Remote Debugging

Configuring Eclipse for Remote Debugging

Configuring a Remote Debugging Configuration in Eclipse

To remotely debug a JBoss application in Eclipse, start the JBoss server in debug mode. Set the JBoss server to debug mode by setting the debug options in the bin/run batch script file. The debugging provided by JBoss is based on the Java Platform Debugger Architecture (JPDA). Set the JAVA_OPTS variable as follows:


set JAVA_OPTS= -Xdebug -Xnoagent 

  -Xrunjdwp:transport=dt_socket,address=8787,

  server=y, suspend=n %JAVA_OPTS%

The different debug parameters are:

Parameter Description
-XDebug Enables debugging
-Xnoagent Disables previous debugging agent.
-Xrunjdwp Specifies the connection mechanism, the transport address, and server and suspend values.

For further explanation of the debug settings, refer to the JPDA documentation.

To demonstrate the remote debugging feature of Eclipse, we need to throw an exception in JBossServlet. As an example, add a NullPointerException to JBossServlet.java by replacing:


out.println("Eclipse JBoss  Debugging");

with


String str=null;



out.println(str.toString());

Next, configure a debug configuration for the Eclipse project. Select the Debug option in the Debug Option List, as shown in Figure 11.

Debug
Figure 11. Debug

This displays the Debug frame. In the Debug frame, select the Remote Java Application node. Right-click the node and select New, as shown in Figure 12.

New debug configuration
Figure 12. New debug configuration

Prev  [1] [2] [3] [4] [5] [6] [7] [8] Next

Close    To Top
  • Prev Article-Java:
  • Next Article-Java:
  • Now: Tutorial for Web and Software Design > Java > Java EE > Java Content
    Photoshop Tutorial
     

    Special Effect

      3D Effect
      Photoshop Articles
    Programming Tutorial
     

    C/C++ Tutorial

      Visual Basic
      C# Tutorial
    Database Tutorial
     

    MySQL Tutorial

      MS SQL Tutorial
      Oracle Tutorial
    Geek Tutorial
     

    Blogging Tutorial

      RSS Tutorial
      Podcasting Tutorial
    Graphic Design Tutorial
      Coreldraw Tutorial
      Illustrator Tutorial
      3D Tutorials
    Webmaster Articles
     

    Domain Service

      Web Hosting
      Site Promotion
    Java Tutorial/ Articles
     

    Java Servlets

      JavaEE Tutorial
     

    JavaBeans Tutorial

    XML Tutorial/ Articles
     

    XML Style

      AJAX Tutorial
      XML Mobile
    Flash Tutorial/ Articles
     

    Flash Video

      Action Script
      Flash Articles
    OS Tutorial/ Articles
      Linux Tutorial
      Symbian Tutorial
      MacOS Tutorial
    Personal Tech
      Hardware Tutorial
      Software Tutorial
      Online Auction