Sun Java System Application Server Platform Edition 9 Quick Start Guide
Sun Java System Application Server Platform Edition 9 Quick Start Guide
Sun Microsystems, Inc. has intellectual property rights relating to technology embodied in the product that is described in this document. In particular, and without
limitation, these intellectual property rights may include one or more U.S. patents or pending patent applications in the U.S. and in other countries.
U.S. Government Rights – Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions
of the FAR and its supplements.
This distribution may include materials developed by third parties.
Parts of the product may be derived from Berkeley BSD systems, licensed from the University of California. UNIX is a registered trademark in the U.S. and other
countries, exclusively licensed through X/Open Company, Ltd.
Sun, Sun Microsystems, the Sun logo, the Solaris logo, the Java Coffee Cup logo, docs.sun.com, JDBC, NetBeans, Java, and Solaris are trademarks or registered
trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of
SPARC International, Inc. in the U.S. and other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc.
The OPEN LOOK and SunTM Graphical User Interface was developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the pioneering efforts
of Xerox in researching and developing the concept of visual or graphical user interfaces for the computer industry. Sun holds a non-exclusive license from Xerox to
the Xerox Graphical User Interface, which license also covers Sun's licensees who implement OPEN LOOK GUIs and otherwise comply with Sun's written license
agreements.
Products covered by and information contained in this publication are controlled by U.S. Export Control laws and may be subject to the export or import laws in
other countries. Nuclear, missile, chemical or biological weapons or nuclear maritime end uses or end users, whether direct or indirect, are strictly prohibited. Export
or reexport to countries subject to U.S. embargo or to entities identified on U.S. export exclusion lists, including, but not limited to, the denied persons and specially
designated nationals lists is strictly prohibited.
DOCUMENTATION IS PROVIDED “AS IS” AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO
THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
Copyright 2007 Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, CA 95054 U.S.A. Tous droits réservés.
Sun Microsystems, Inc. détient les droits de propriété intellectuelle relatifs à la technologie incorporée dans le produit qui est décrit dans ce document. En particulier,
et ce sans limitation, ces droits de propriété intellectuelle peuvent inclure un ou plusieurs brevets américains ou des applications de brevet en attente aux Etats-Unis
et dans d'autres pays.
Cette distribution peut comprendre des composants développés par des tierces personnes.
Certaines composants de ce produit peuvent être dérivées du logiciel Berkeley BSD, licenciés par l'Université de Californie. UNIX est une marque déposée aux
Etats-Unis et dans d'autres pays; elle est licenciée exclusivement par X/Open Company, Ltd.
Sun, Sun Microsystems, le logo Sun, le logo Solaris, le logo Java Coffee Cup, docs.sun.com, JDBC, NetBeans, Java et Solaris sont des marques de fabrique ou des
marques déposées de Sun Microsystems, Inc. aux Etats-Unis et dans d'autres pays. Toutes les marques SPARC sont utilisées sous licence et sont des marques de
fabrique ou des marques déposées de SPARC International, Inc. aux Etats-Unis et dans d'autres pays. Les produits portant les marques SPARC sont basés sur une
architecture développée par Sun Microsystems, Inc.
L'interface d'utilisation graphique OPEN LOOK et Sun a été développée par Sun Microsystems, Inc. pour ses utilisateurs et licenciés. Sun reconnaît les efforts de
pionniers de Xerox pour la recherche et le développement du concept des interfaces d'utilisation visuelle ou graphique pour l'industrie de l'informatique. Sun détient
une licence non exclusive de Xerox sur l'interface d'utilisation graphique Xerox, cette licence couvrant également les licenciés de Sun qui mettent en place l'interface
d'utilisation graphique OPEN LOOK et qui, en outre, se conforment aux licences écrites de Sun.
Les produits qui font l'objet de cette publication et les informations qu'il contient sont régis par la legislation américaine en matière de contrôle des exportations et
peuvent être soumis au droit d'autres pays dans le domaine des exportations et importations. Les utilisations finales, ou utilisateurs finaux, pour des armes nucléaires,
des missiles, des armes chimiques ou biologiques ou pour le nucléaire maritime, directement ou indirectement, sont strictement interdites. Les exportations ou
réexportations vers des pays sous embargo des Etats-Unis, ou vers des entités figurant sur les listes d'exclusion d'exportation américaines, y compris, mais de manière
non exclusive, la liste de personnes qui font objet d'un ordre de ne pas participer, d'une façon directe ou indirecte, aux exportations des produits ou des services qui
sont régis par la legislation américaine en matière de contrôle des exportations et la liste de ressortissants spécifiquement designés, sont rigoureusement interdites.
LA DOCUMENTATION EST FOURNIE "EN L'ETAT" ET TOUTES AUTRES CONDITIONS, DECLARATIONS ET GARANTIES EXPRESSES OU TACITES
SONT FORMELLEMENT EXCLUES, DANS LA MESURE AUTORISEE PAR LA LOI APPLICABLE, Y COMPRIS NOTAMMENT TOUTE GARANTIE
IMPLICITE RELATIVE A LA QUALITE MARCHANDE, A L'APTITUDE A UNE UTILISATION PARTICULIERE OU A L'ABSENCE DE CONTREFACON.
070417@17039
Quick Start Guide
This guide describes basic steps for starting the Sun JavaTM System Application Server software,
(henceforth referred to as Application Server), and packaging and deploying applications. It
also provides information about the Admin Console and command-line tools. You must have
already installed the product to use this Quick Start Guide. For more information, see Sun Java
System Application Server Platform Edition 9 Installation Guide.
The intended audience for this guide is the system administrator, network administrator,
Application Server administrator, and developer who is interested in learning the basics about
Application Server software.
For information about conventions used in this document, see “Documentation Conventions”
on page 15.
3
Starting and Verifying the Server
For administration tasks, the Application Server software provides these tools, which enable
administrators to manage server instances:
■ The Admin Console, a browser-based graphical user interface (GUI)
■ The asadmin utility, a command-line tool
You start the server by starting the domain. A domain provides authentication and
administration for the server instance that belongs to it. Starting the domain starts the server
instance in the domain. A default domain called domain1 is created when you install
Application Server.
Note – If you are using the Application Server that comes bundled with the Solaris operating
system, no default domain is created. Instead, you must create one using asadmin
create-domain. See the documentation for create-domain(1) for more information.
Note – If you are using the Ubuntu Linux version of the server, a default domain is created in
/var/lib/sunappserver/domains. You can administer this domain using the
install-dir/bin/asadmin command. If you do not have root access or you want to have domains
running in your home directory, you can use the asadmin convenience wrapper script located
in /usr/bin to create a domain in your home directory. Running asadmin start-domain from
the convenience script creates and starts the domain. For more information on the convenience
script, type asadmin man at the command prompt.
If you have root access, you can also create and start domains using the asadmin commands
create-domain and start-domain from the install-dir/bin directory. These domains are
created by default in /var/lib/sunappserver/domains. For more information on
create-domain and start-domain, see the asadmin help.
4 Sun Java System Application Server Platform Edition 9 Quick Start Guide •
Starting and Verifying the Server
1 From the Start menu, choose Programs ⇒ Sun Microsystems ⇒ Application Server PE 9 ⇒ Start
Default Server.
A command window appears showing initialization messages. When the server has started, a
message appears stating that the server has been started and is ready to receive requests. The
output also includes information on ports used by the Application Server.
See Also You can also use the asadmin start-domain domain1 command to start the server. Before
using asadmin, see “To Configure the Windows Environment to Use the Command-Line
Tools” on page 13.
When you see this page, you know that the server is running. If you encounter problems,
check your server and browser settings, as described in the Sun Java System Application
Server Platform Edition 9 Troubleshooting Guide.
1 Find install-dir/samples/quickstart/hello.war.
Tip – On Windows, you can create a shortcut to the autodeploy directory on your desktop, and
then drag and drop the hello.war file onto the shortcut.
6 Sun Java System Application Server Platform Edition 9 Quick Start Guide •
Starting and Verifying the Server
When the server has finished deploying the application, it creates a file named
hello.war_deployed in the autodeploy directory. Depending on the speed of your system, the
process can take a few seconds. Until that file appears, a 404-File Not Found error occurs when
you try to visit the application page.
Note – You can also use the asadmin command-line utility to deploy from the command line or
in a shell script. The command is asadmin deploy. For more information, see the deploy(1)
command documentation in the Sun Java System Application Server Platform Edition 9
Reference Manual. Other deployment methods are discussed later in the Guide in “To Deploy
From the Admin Console” on page 10, and “To Deploy From a Development Directory” on
page 11. It is also possible to dynamically reload changes to your application. For more
information, see “Dynamic Reloading” in Sun Java System Application Server Platform Edition 9
Application Deployment Guide.
For further information about using the Admin Console, consult the online help or the Sun Java
System Application Server Platform Edition 9 Administration Guide.
1 Access http://localhost:4848/.
■ localhost is used if the both the browser and the Application Server are running on the same
system. If the Application Server is running on another system, substitute the name of that
system in the URL.
■ 4848 is the Admin Console’s default port number. If you changed the port number during
the installation, use that number instead. The port number is included in the output for
asadmin start-domain.
Tip – Windows users can also use the Start menu option: Programs ⇒ Sun Microsystems ⇒
Application Server PE 9 ⇒Admin Console.
2 Enter the administration user name and password, specified when you installed the product.
Use the items in the tree to configure a variety of operational settings for Application Server
software. Launch online help from the button in the upper right corner.
8 Sun Java System Application Server Platform Edition 9 Quick Start Guide •
Packaging and Deploying Applications
To see the server’s log file, click Search Log Files under the Common Tasks heading in the right
pane. When the Log Viewer window appears, set criteria and click Search to display status
messages from the server and output from your Java EE application.
1 Make sure that you are logged in as the user that installed the database.
The Hello application deployed earlier was already packaged into a WAR file. This section
covers packaging the application's components into another WAR file. The build.xml file
included with the Hello application contains the build targets.
1 If you have not already added install-dir/bin to your PATH environment variable, do so now.
2 Go to install-dir/samples/quickstart/ directory.
1 Click http://localhost:4848/asadmin.
■ localhost is used if the both the browser and the Application Server are running on the same
system. If the Application Server is running on another system, substitute the name of that
system in the URL.
■ 4848 is the Admin Console’s default port number. If you changed the port number during
the installation, use that number instead.
5 If you already have a Hello application deployed, undeploy it now by selecting the checkbox
next to it and clicking Undeploy.
10 Sun Java System Application Server Platform Edition 9 Quick Start Guide •
Packaging and Deploying Applications
6 To deploy the newly assembled Hello application, on the Web Applications page, click Deploy.
7 Select the Package file to upload to the Application Server option and click Browse.
9 Click Next.
The process can be performed interactively by using the Admin Console, or by using asadmin
deploydir from the command line or in a script. The steps for the command line are presented
here, because most developers want to automate the procedure in command scripts.
Note – Before using asadmin on Windows, see “To Configure the Windows Environment to Use
the Command-Line Tools” on page 13.
2 Unzip the contents of the hello.war file into the hello2/ directory.
Preserve the directory structure of the hello.war file when you unzip it. It is a template for the
kind of file structure you need to deploy directly from a directory.
3 If you already have a Hello application deployed, undeploy it now using the command asadmin
undeploy hello at the command line.
If you did not install the Application Server with the “Don’t prompt” option, also specify the
option --user username, where username is the admin user name. You are prompted for the
administration password.
appclient Launches the Application Client Container and invokes the client
application packaged in the application Java archive (JAR) file.
asant Launches the Jakarta Ant tool, so that you can automate repetitive
development and deployment tasks.
asapt Compiles Java sources with Java EE annotations. The tool automatically
invokes the wsimport command.
capture-schema Extracts schema information from a database and produces a schema file
that the server can use for Container Managed Persistence (CMP).
package-appclient Packages the application client container libraries and JAR files.
schemagen Creates a schema file for each namespace referenced in your Java classes.
12 Sun Java System Application Server Platform Edition 9 Quick Start Guide •
Using Command-Line Tools
wscompile Takes the service definition interface and generates the client stubs or
server-side skeletons for JAX-RPC; or generates a Web Services Description
Language (WSDL) description for the provided interface.
wsgen Reads a web service endpoint class and generates all the required artifacts
for web service deployment and invocation.
xjc Transforms, or binds, a source XML schema to a set of JAXB content classes
in the Java programming language.
a. Click Edit.
b. In Variable Value, enter the path to the server’s bin directory, separated from other
entries by a semicolon. For example:
install-dir/bin;other_entries
a. Click New.
6 In the User variables section, add the environment variable AS_ADMIN_USER and set it to the
administrative user name that you assigned during installation.
If you set this variable, you do not need to enter the administrative user name when you run
asadmin commands.
Note – If you installed the server with the “Don't Prompt for Admin User Name” option selected,
you do not need to create the AS_ADMIN_USER variable.
7 Click OK to commit the change and close the remaining open windows.
Where to Go Next
Other resources for learning about and using Application Server are available. They include the
following:
■ The server’s Installation Complete page at install_dir/docs/about.html.
See this document for the latest information on what is new, and pointers to tutorials and
other educational services.
■ Sun Java System Application Server Platform Edition 9 Release Notes
See this document for late-breaking changes and other information regarding this release.
■ Sun Java System Application Server Platform Edition 9 Administration Guide
See this guide for information on performing administrative functions using the Admin
Console.
■ Sun Java System Application Server Platform Edition 9 Application Deployment Guide
See this guide for information on assembling and deploying applications.
■ Sun Java System Application Server Platform Edition 9 Reference Manual (man pages)
14 Sun Java System Application Server Platform Edition 9 Quick Start Guide •
Documentation Conventions
See this document for reference information on Application Server command-line utilities,
such as asadmin.
■ The Java EE 5 Tutorial
(http://java.sun.com/javaee/5/docs/tutorial/doc/index.html)
See this document for a tutorial that covers the process for building and deploying Java
Platform, Enterprise Edition (Java EE platform) applications.
■ Java BluePrints (http://java.sun.com/blueprints)
See this web site for a comprehensive set of examples that demonstrate operations of the
Application Server software and that can be used as application templates.
■ NetBeans.org (http://www.netbeans.org)
See this site to download the NetBeans IDE and view the documentation, including
installation instructions and Quick Start Guides.
■ Project GlassFish (http://glassfish.dev.java.net/)
See this site for information on the open source Java EE 5 Application Server.
Documentation Conventions
This section describes the types of conventions used throughout this guide.
General Conventions
The following general conventions are used in this guide:
■ File and directory paths are given in UNIX® format (with forward slashes separating
directory names). For Windows versions, the directory paths are the same, except that
backslashes are used to separate directories.
■ Installation root directories for most platforms are indicated by install-dir in this
document.
By default, the location of install-dir on most platforms is:
■ Solaris bundled version:
/usr/appserver
■ Other Solaris and Redhat Linux installations, non-root user:
user’s-home-directory/SUNWappserver
■ Other Solaris and Redhat Linux installations, root user:
/opt/SUNWappserver
■ Ubuntu Linux Users:
/usr/share/sunappserver
However, for Solaris bundled installations, the directory containing all the domains can be
changed to another directory during installation.
Typographic Conventions
The following table describes the typographic changes that are used in this document.
AaBbCc123 The names of commands, files, and directories, and Edit your .login file.
onscreen computer output
Use ls -a to list all files.
machine_name% you have mail.
AaBbCc123 What you type, contrasted with onscreen computer output machine_name% su
Password:
AaBbCc123 A placeholder to be replaced with a real name or value The command to remove a file is rm
filename.
AaBbCc123 Book titles, new terms, and terms to be emphasized (note Read Chapter 6 in the User's Guide.
that some emphasized items appear bold online)
A cache is a copy that is stored locally.
Do not save the file.
16 Sun Java System Application Server Platform Edition 9 Quick Start Guide •