Sun GlassFish Enterprise Server 2.1 Developer's Guide

Enabling Debugging

When you enable debugging, you enable both local and remote debugging. To start the server in debug mode, use the --debug option as follows:


asadmin start-domain --user adminuser --debug [domain-name]

You can then attach to the server from the Java Debugger (jdb) at its default Java Platform Debugger Architecture (JPDA) port, which is 9009. For example, for UNIX® systems:

jdb -attach 9009

For Windows:

jdb -connect com.sun.jdi.SocketAttach:port=9009

For more information about the jdb debugger, see the following links:

Enterprise Server debugging is based on the JPDA. For more information, see JPDA Options.

You can attach to the Enterprise Server using any JPDA compliant debugger, including that of NetBeans, Sun Java Studio, JBuilder, Eclipse, and so on.

You can enable debugging even when the application server is started without the --debug option. This is useful if you start the application server from the Windows Start Menu, or if you want to make sure that debugging is always turned on.

ProcedureTo Set the Server to Automatically Start Up in Debug Mode

  1. Use the Admin Console. In the developer profile, select the Enterprise Server component and the JVM Settings tab. In the cluster profile, select the JVM Settings component under the relevant configuration.

  2. Check the Debug Enabled box.

  3. To specify a different port (from 9009, the default) to use when attaching the JVM to a debugger, specify address= port-number in the Debug Options field.

  4. To add JPDA options, add any desired JPDA debugging options in Debug Options. See JPDA Options.

See Also

For details, click the Help button in the Admin Console from the JVM Settings page.