You can use an IDE (integrated development environment) with the Application Server to take advantage of the IDE's debugging features.
Download the latest version of NetBeans from http://www.netbeans.org.
Set up the classpath in NetBeans to compile J2EE applications using the standard J2EE 1.4 API libraries provided with the Application Server.
Perform the following steps in the NetBeans IDE:
In the Menu bar, click on the File menu and select Mount Filesystem.
In the wizard dialog box, select Archive Files as the Filesystem type and click Next.
Navigate the file chooser to the Application Server directory install-dir/lib.
Select j2ee.jar. To use Sun-specific public APIs provided in the Application Server, select the appserv-ext.jar archive as well. Click Finish.
The j2ee.jar file should appear in the list of mounted file systems under the Editing pane inside the Filesystems tab of the NetBeans IDE. You can now import J2EE 1.4 API packages in your source files and compile the source files.
Build your application in the NetBeans IDE.
Assemble your application into a J2EE archive file (WAR, JAR, RAR or EAR file) and deploy it to the Application Server.
Start the Application Server with debugging enabled. See Enabling Debugging.
Attach to the Application Server using the NetBeans IDE debugger:
Click on the Debug menu, select Start Session, then select Attach.
In the Attach dialog box, make sure the host (default localhost) and port (default 9009) correspond to the host and JPDA debug port of the Application Server. Click OK.
The Output Window of the Debugger Console should display the message Connection established.
Set break points in your source file in the NetBeans IDE as usual, and run the application.
When finished with debugging, detach from the server by clicking Finish in the Debug menu.