Document Information

Preface

Part I Introduction

1.  Overview

2.  Using the Tutorial Examples

Required Software

JavaTM Platform, Standard Edition

Java EE 6 Software Development Kit (SDK)

SDK Installation Tips

Apache Ant

To Obtain Apache Ant

Java EE 6 Tutorial Component

To Obtain the Tutorial Component

NetBeans IDE

To Add Enterprise Server as a Server in NetBeans IDE

Starting and Stopping the Enterprise Server

Starting the Administration Console

To Start the Administration Console in NetBeans IDE

Starting and Stopping the Java DB Database Server

Building the Examples

Tutorial Example Directory Structure

Getting the Latest Updates to the Tutorial

To Update the Tutorial through the Update Center

Part II The Web Tier

3.  Getting Started with Web Applications

4.  JavaServerTM Faces Technology

5.  Introduction to Facelets

6.  Unified Expression Language

7.  Using JavaServerTM Faces Technology in Web Pages

8.  Using Converters, Listeners and Validators

9.  Developing With JavaServerTM Faces Technology

10.  Java Servlet Technology

Part III Web Services

11.  Introduction to Web Services

12.  Building Web Services with JAX-WS

13.  Building RESTful Web Services with JAX-RS and Jersey

Part IV Enterprise Beans

14.  Enterprise Beans

15.  Getting Started with Enterprise Beans

16.  Running the Enterprise Bean Examples

Part V Contexts and Dependency Injection for the JavaTM EE Platform

17.  Introduction to Contexts and Dependency Injection for the JavaTM EE Platform

18.  Running the Basic Contexts and Dependency Injection Examples

Part VI Persistence

19.  Introduction to the Java Persistence API

20.  Running the Persistence Examples

21.  The Java Persistence Query Language

22.  Creating Queries Using the Criteria API

Part VII Security

23.  Introduction to Security in the Java EE Platform

24.  Getting Started Securing Enterprise Applications

25.  Getting Started Securing Web Applications

Part VIII JavaTM EE Supporting Technologies

26.  Introduction to JavaTM EE Supporting Technologies

27.  Transactions

28.  Resource Connections

Index

 

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 Enterprise 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 http://java.sun.com/javase/6/docs/technotes/guides/logging/index.html) and from web components with the ServletContext.log method.

If you start the Enterprise 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 Enterprise 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 Administration Console log viewer.

To use the log viewer:

  1. Select the Enterprise Server node.

  2. Click the View Log Files 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 top of the log viewer.

Using a Debugger

The Enterprise Server supports the Java Platform Debugger Architecture (JPDA). With JPDA, you can configure the Enterprise Server to communicate debugging information using a socket.

To debug an application using a debugger:

  1. Enable debugging in the Enterprise Server using the Administration Console:

    1. Expand the Configuration node.

    2. Select the JVM Settings node. The default debug options are set to:

      -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9009

      As you can see, the default debugger socket port is 9009. You can change it to a port not in use by the Enterprise Server or another service.

    3. Select the Debug Enabled check box.

    4. Click the Save button.

  2. Stop the Enterprise Server and then restart it.