Part I Development Tasks and Tools
1. Setting Up a Development Environment
Generating a Stack Trace for Debugging
GlassFish Server Message Queue Debugging
To Use HPROF Profiling on UNIX
To Enable Remote Profiling With JProbe
Part II Developing Applications and Application Components
6. Using the Java Persistence API
7. Developing Web Applications
8. Using Enterprise JavaBeans Technology
9. Using Container-Managed Persistence
12. Developing Lifecycle Listeners
13. Developing OSGi-enabled Java EE Applications
Part III Using Services and APIs
14. Using the JDBC API for Database Access
15. Using the Transaction Service
16. Using the Java Naming and Directory Interface
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 --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:
Java Platform Debugger Architecture - The Java Debugger: http://java.sun.com/javase/technologies/core/toolsapis/jpda/
Java Platform Debugger Architecture - Connecting with JDB: http://java.sun.com/javase/technologies/core/toolsapis/jpda/
GlassFish Server debugging is based on the JPDA. For more information, see JPDA Options.
You can attach to the GlassFish Server using any JPDA compliant debugger, including that of NetBeans, Java Studio Enterprise, JBuilder, Eclipse, and so on.
You can enable debugging even when the GlassFish Server is started without the ----debug option. This is useful if you start the GlassFish Server from the Windows Start Menu, or if you want to make sure that debugging is always turned on.
See Also
For details, click the Help button in the Administration Console from the JVM Settings page.