Debugging Java EE Applications
Debugging Java EE Applications
Examples that have multiple application modules packaged into an enterprise application
archive (or EAR) have submodule directories that use the following naming conventions:
example-name-app-client: Application clients
example-name-ejb: Enterprise bean JAR files
example-name-war: web applications
The Ant build files (build.xml) distributed with the examples contain targets to create a build
subdirectory and to copy and compile files into that directory; a dist subdirectory, which holds
the packaged module file; and a client-jar directory, which holds the retrieved application
client JAR.
Debugging Java EE Applications
This section describes how to determine what is causing an error in your application
deployment or execution.
Using the Server Log
One way to debug applications is to look at the server log in domain-dir/logs/server.log. The
log contains output from the Application Server and your applications. You can log messages
from any Java class in your application with System.out.println and the Java Logging APIs
(documented at
web components with the ServletContext.log method.
If you start the Application Server with the --verbose flag, all logging and debugging output
will appear on the terminal window or command prompt and the server log. If you start the
Application Server in the background, debugging information is only available in the log. You
can view the server log with a text editor or with the Admin Console log viewer.
To use the log viewer:
1. Select the Application Server node.
2. Select the Logging tab.
3. Click the Open Log Viewer button. The log viewer will open and display the last 40 entries.
If you wish to display other entries:
1. Click the Modify Search button.
2. Specify any constraints on the entries you want to see.
3. Click the Search button at the bottom of the log viewer.
Debugging Java EE Applications
The Java EE 5 Tutorial · September 2007
72