Download
FAQ
History
PrevHomeNext API
Search
Feedback
Divider

Sun Java System Application Server Platform Edition 8

The Sun Java System Application Server Platform Edition 8 is a fully compliant implementation of the J2EE 1.4 platform. In addition to supporting all the APIs described in the previous sections, the Application Server includes a number of J2EE technologies and tools that are not part of the J2EE 1.4 platform but are provided as a convenience to the developer.

This section briefly summarizes the technologies and tools that make up the Application Server, and instructions for starting and stopping the Application Server, starting the Admin Console, starting deploytool, and starting and stopping the PointBase database server. Other chapters explain how to use the remaining tools.

Technologies

The Application Server includes two user interface technologies--JavaServer Pages Standard Tag Library and JavaServerTrademarked Faces--that are built on and used in conjunction with the J2EE 1.4 platform technologies Java servlet and JavaServer Pages.

JavaServer Pages Standard Tag Library

The JavaServer Pages Standard Tag Library (JSTL) encapsulates core functionality common to many JSP applications. Instead of mixing tags from numerous vendors in your JSP applications, you employ a single, standard set of tags. This standardization allows you to deploy your applications on any JSP container that supports JSTL and makes it more likely that the implementation of the tags is optimized.

JSTL has iterator and conditional tags for handling flow control, tags for manipulating XML documents, internationalization tags, tags for accessing databases using SQL, and commonly used functions.

JavaServer Faces

JavaServer Faces technology is a user interface framework for building Web applications. The main components of JavaServer Faces technology are as follows:

The following features support the GUI components:

All this functionality is available via standard Java APIs and XML-based configuration files.

Tools

The Application Server contains the tools listed in Table 1-1. Basic usage information for many of the tools appears throughout the tutorial. For detailed information, see the online help in the GUI tools and the man pages at http://docs.sun.com/db/doc/817-6092 for the command-line tools.

Table 1-1 Application Server Tools
Component
Description
Admin Console
A Web-based GUI Application Server administration utility. Used to stop the Application Server and manage users, resources, and applications.
asadmin
A command-line Application Server administration utility. Used to start and stop the Application Server and manage users, resources, and applications.
asant
A portable command-line build tool that is an extension of the Ant tool developed by the Apache Software Foundation (see http://ant.apache.org/). asant contains additional tasks that interact with the Application Server administration utility.
appclient
A command-line tool that launches the application client container and invokes the client application packaged in the application client JAR file.
capture-schema
A command-line tool to extract schema information from a database, producing a schema file that the Application Server can use for container-managed persistence.
deploytool
A GUI tool to package applications, generate deployment descriptors, and deploy applications on the Application Server.
package-appclient
A command-line tool to package the application client container libraries and JAR files.
PointBase database
An evaluation copy of the PointBase database server.
verifier
A command-line tool to validate J2EE deployment descriptors.
wscompile
A command-line tool to generate stubs, ties, serializers, and WSDL files used in JAX-RPC clients and services.
wsdeploy
A command-line tool to generate implementation-specific, ready-to-deploy WAR files for Web service applications that use JAX-RPC.

Starting and Stopping the Application Server

To start and stop the Application Server, you use the asadmin utility. To start the Application Server, open a terminal window or command prompt and execute the following:

asadmin start-domain --verbose domain1 

A domain is a set of one or more Application Server instances managed by one administration server. Associated with a domain are the following:

You specify these values when you install the Application Server. The examples in this tutorial assume that you choose the default ports.

With no arguments, the start-domain command initiates the default domain, which is domain1. The --verbose flag causes all logging and debugging output to appear on the terminal window or command prompt (it will also go into the server log, which is located in <J2EE_HOME>/domains/domain1/logs/server.log).

Or, on Windows, you can choose

      ProgramsRight ArrowSun MicrosystemsRight ArrowJ2EE 1.4 SDKRight ArrowStart Default Server

After the server has completed its startup sequence, you will see the following output:

Domain domain1 started. 

To stop the Sun Java System Application Server, open a terminal window or command prompt and execute

asadmin stop-domain domain1 

Or, on Windows, choose

      ProgramsRight ArrowSun MicrosystemsRight ArrowJ2EE 1.4 SDKRight ArrowStop Default Server

When the server has stopped you will see the following output:

Domain domain1 stopped. 

Starting the Admin Console

To administer the Application Server and manage users, resources, and J2EE applications, you use the Admin Console tool. The Application Server must be running before you invoke the Admin Console. To start the Admin Console, open a browser at the following URL:

http://localhost:4848/asadmin/ 

On Windows, from the Start menu, choose

      ProgramsRight ArrowSun MicrosystemsRight ArrowJ2EE 1.4 SDKRight ArrowAdmin Console

Starting the deploytool Utility

To package J2EE applications, specify deployment descriptor elements, and deploy applications on the Sun Java System Application Server, you use the deploytool utility. To start deploytool, open a terminal window or command prompt and execute

deploytool 

On Windows, from the Start menu, choose

      ProgramsRight ArrowSun MicrosystemsRight ArrowJ2EE 1.4 SDKRight ArrowDeploytool

Starting and Stopping the PointBase Database Server

To start the PointBase database server, follow these steps.

  1. In a terminal window, go to <J2EE_HOME>/pointbase/tools/serveroption.
  2. Execute the startserver script.

On Windows, from the Start menu, choose

ProgramsRight ArrowSun MicrosystemsRight ArrowJ2EE 1.4 SDKRight ArrowStart PointBase

To stop the PointBase server, follow these steps.

  1. In a terminal window, go to <J2EE_HOME>/pointbase/tools/serveroption.
  2. Execute the stopserver script.

On Windows, from the Start menu, choose

ProgramsRight ArrowSun MicrosystemsRight ArrowJ2EE 1.4 SDKRight ArrowStop PointBase

Debugging J2EE 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 <J2EE_HOME>/domains/domain1/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 http://java.sun.com/j2se/1.4.2/docs/guide/util/logging/index.html) and from 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.

Using a Debugger

The Application Server supports the Java Platform Debugger Architecture (JPDA). With JPDA, you can configure the Application Server to communicate debugging information via a socket. In order to debug an application using a debugger:

  1. Enable debugging in the Application Server using the Admin Console as follows:
    1. Select the Application Server node.
    2. Select the JVM Settings tab. The default debug options are set to:
    3. -Xdebug -Xrunjdwp:transport=dt_socket,server=y,
        suspend=n,address=1044

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

    4. Check the Enabled box of the Debug field.
    5. Click the Save button.
  2. Stop the Application Server and then restart it.
  3. Compile your Java source with the -g flag.
  4. Package and deploy your application.
  5. Start a debugger and connect to the debugger socket at the port you set when you enabled debugging.
Divider
Download
FAQ
History
PrevHomeNext API
Search
Feedback
Divider

All of the material in The J2EE(TM) 1.4 Tutorial is copyright-protected and may not be published in other works without express written permission from Sun Microsystems.