Getting Started With Sun Java System Application Server 9.1 Update 2 Student Guide Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054 U.S.A. August 2008 Copyright 2008 Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, CA 95054 U.S.A. All rights reserved. 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, Enterprise JavaBeans, EJB, GlassFish, J2EE, J2SE, JavaBeans, Javadoc, JDBC, JDK, JavaScript, JavaServer Pages, JSP, JVM, NetBeans, SunSolve, Java, and Solaris are trademarks or registered trademarks of Sun Microsystems, Inc. or its subsidiaries 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 2008 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, Enterprise JavaBeans, EJB, GlassFish, J2EE, J2SE, JavaBeans, Javadoc, JDBC, JDK, JavaScript, JavaServer Pages, JSP, JVM, NetBeans, SunSolve, Java et Solaris sont des marques de fabrique ou des marques déposées de Sun Microsystems, Inc., ou ses filiales, 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. 080811@20795 Contents 1 2 Installing Sun Java System Application Server ......................................................................5 Installing Sun Java System Application Server With MySQL Community Server ..............6 Getting Started With the Application Server Administrative Interfaces ...........................9 Getting Started With the Application Server Command-Line Interface (CLI) .................10 Getting Started With the Admin Console GUI ......................................................................14 3 Deploying an Application and Monitoring the Application Server ..................................17 Deploying the hello Sample Application ..............................................................................18 Monitoring the Application Server ..........................................................................................20 4 Extending the Application Server Through the Update Center ........................................23 Adding the Java EE 5 Samples Module to the Application Server Through the Update Center ..........................................................................................................................................24 5 Resources for Using Application Server ................................................................................ 27 Sources of Information .............................................................................................................28 3 4 1 M O D U L E 1 Installing Sun Java System Application Server Objectives Learn how to install Sun Java System Application Server 5 Installing Sun Java System Application Server With MySQL Community Server Installing Sun Java System Application Server With MySQL Community Server The objective of this exercise is to teach you how to install Sun Java System Application Server With MySQL Community Server from the instructions in the product documentation. Preparation Ensure that the following prerequisites are met: ■ Sun Java System Application Server+MySQL bundle is downloaded. ■ Java 2 SDK, version 6.0 or a compatible version is installed on the machine where you are installing the Sun Java System Application Server+MySQL bundle. Summary In this exercise, you will install Sun Java System Application Server With MySQL Community Server with default options. 6 Getting Started With Sun Java System Application Server 9.1 Update 2 • August 2008 Installing Sun Java System Application Server With MySQL Community Server To Install Sun Java System Application Server With MySQL Community Server 1 Follow the instructions to install Sun Java System Application Server with MySQL Community Server (http://docs.sun.com/doc/820-3797/ggkew) in Sun Java System Application Server 9.1 Update 1 Installation Guide. When the installation wizard prompts you, specify the following options: ■ ■ ■ ■ ■ ■ ■ ■ Default installation directory Default port assignments Default administration user name admin Administration user name and password stored in a file No upgrade Update Center Client not enabled No registration with the SunSM Connection service No automatic start-up of the default domain Module 1 • Installing Sun Java System Application Server 7 Installing Sun Java System Application Server With MySQL Community Server Discussion The benefits of registering the Sun Java System Application Server with the Sun Connection service are explained in the index.html page in the document root folder of this domain's default virtual server. This page is available at http://localhost:8080 on any host where a domain is running. 8 Getting Started With Sun Java System Application Server 9.1 Update 2 • August 2008 2 M O D U L E 2 Getting Started With the Application Server Administrative Interfaces Objectives Become familiar with the Application Server administrative interfaces: ■ ■ Command-line interface (CLI) Admin Console graphical user interface (GUI) Additional Resources Tools for Administration (http://docs.sun.com/doc/819-3671/ablav) in Sun Java System Application Server 9.1 Administration Guide . 9 Getting Started With the Application Server Command-Line Interface (CLI) Getting Started With the Application Server Command-Line Interface (CLI) The objectives of this exercise are as follows: ■ To familiarize you with the Application Server CLI ■ To teach you how to start the default domain of an Application Server installation Summary This exercise demonstrates the following features of the Application Server CLI: ■ The asadmin utility is the Application Server CLI. ■ Application Server administrative tasks are performed through subcommands of the asadmin utility. ■ The asadmin utility displays close matches for mistyped subcommands. ■ Online help is available for the asadmin utility and for each subcommand. ■ Subcommands can be run as follows: ■ ■ From within the asadmin utility At the shell's command prompt This exercise also demonstrates how to start the default domain on the different platforms on which the Application Server is supported. 10 Getting Started With Sun Java System Application Server 9.1 Update 2 • August 2008 Getting Started With the Application Server Command-Line Interface (CLI) To Explore the asadmin Utility 1 In a terminal or shell window, change to the bin subdirectory of the Application Server installation directory. prompt% cd as-install/bin as-install 2 The directory where the Application Server software is installed. Start the asadmin utility. prompt% asadmin Use "exit" to exit and "help" for online help. asadmin> 3 Obtain a list of the subcommands of the asadmin utility. asadmin> help 4 Mistype a subcommand of the asadmin utility. asadmin> start-domian CLI147 Invalid command, start-domian Closest matching command(s): start-domain Use "help" command for a list of valid commands. 5 Obtain help for the start-domain subcommand of the asadmin utility. a. Obtain help for the subcommand from within the asadmin utility. asadmin> help start-domain b. Exit the asadmin utility. asadmin> exit c. Obtain help for the subcommand at the shell's command prompt. prompt% asadmin start-domain --help |more Module 2 • Getting Started With the Application Server Administrative Interfaces 11 Getting Started With the Application Server Command-Line Interface (CLI) To Start the Default Domain 1 2 12 Follow the instructions in Sun Java System Application Server 9.1 Administration Guide (http://docs.sun.com/doc/819-3671) for your operating system. ■ For the SolarisTM operating system or Linux operating system, follow the instructions in Starting the Domain (http://docs.sun.com/doc/819-3671/ablbf). ■ For the Windows operating system, follow the instructions in Starting the Default Domain on Windows (http://docs.sun.com/doc/819-3671/ablbg). Confirm that the domain is running by viewing the index.html page at http://localhost:8080 on the host where the domain is started. Getting Started With Sun Java System Application Server 9.1 Update 2 • August 2008 Getting Started With the Application Server Command-Line Interface (CLI) Discussion More information about the Application Server, samples, documentation, and additional resources, is available at as-install/docs/about.html, where as-install is the Application Server installation directory. Module 2 • Getting Started With the Application Server Administrative Interfaces 13 Getting Started With the Admin Console GUI Getting Started With the Admin Console GUI The objectives of this exercise are as follows: ■ To familiarize you with the Admin Console GUI ■ To teach you how to obtain more information about the Application Server from the Admin Console GUI Summary This exercise demonstrates the following features of the Admin Console GUI: 14 ■ The Admin Console GUI is browser based. ■ The navigation tree of the Admin Console GUI provides easy access to the objects that are to be administered through the GUI. ■ Context sensitive online help is available for each page in the Admin Console GUI. Getting Started With Sun Java System Application Server 9.1 Update 2 • August 2008 Getting Started With the Admin Console GUI To Explore the Admin Console GUI 1 Follow the instructions in Administration Console (http://docs.sun.com/doc/819-3671/ablaw) in Sun Java System Application Server 9.1 Administration Guide to start the Admin Console on the machine where you installed the Application Server software. 2 Log in to the Admin Console GUI with the default administration user name admin and the password that you specified when you installed the Application Server software. The Common Tasks page is displayed with the navigation tree to the left of the page. 3 In the navigation tree, select the Application Server node. The Application Server General Information page is displayed. 4 In the Application Server General Information page, click Help. Context-sensitive help for this page is displayed. 5 In the navigation tree, expand the Configuration node. 6 Under the Configuration node, select something that can be configured, for example Monitoring. The appropriate page is displayed. 7 In the page that is displayed, click Help. The help is updated to display context-sensitive help for this page. 8 Click Home to return to the Common Tasks page. 9 Under Documentation, click Developer's Guide. The table of contents for Sun Java System Application Server 9.1 Developer's Guide on the docs.sun.comSM site (http://docs.sun.com) is opened. 10 Log out of the Admin Console. Module 2 • Getting Started With the Application Server Administrative Interfaces 15 16 3 M O D U L E 3 Deploying an Application and Monitoring the Application Server Objectives Learn how to deploy an application in the Application Server. Become familiar with the monitoring capabilities of the Application Server. 17 Deploying the hello Sample Application Deploying the hello Sample Application The objective of this exercise is to teach you how to use the Admin Console to deploy an application in the Application Server. Summary In this exercise, you will use the Admin Console to deploy a prepackaged web application in the Application Server. 18 Getting Started With Sun Java System Application Server 9.1 Update 2 • August 2008 Deploying the hello Sample Application To Deploy the hello Sample Application 1 Follow the instructions in Sun Java System Application Server 9.1 Quick Start Guide to deploy the hello application by using Admin Console (http://docs.sun.com/doc/819-3193/geyxd). Module 3 • Deploying an Application and Monitoring the Application Server 19 Monitoring the Application Server Monitoring the Application Server The objectives of this exercise are as follows: ■ To teach you how to enable monitoring for the Application Server ■ To introduce the data that the Application Server gathers through monitoring and in log files Summary In this exercise, you will use the Admin Console to familiarize yourself with the monitoring features of the Application Server. 20 Getting Started With Sun Java System Application Server 9.1 Update 2 • August 2008 Monitoring the Application Server To Monitor the Application Server 1 Follow the instructions in Sun Java System Application Server 9.1 Administration Guide to use the Admin Console to set the monitoring level (http://docs.sun.com/doc/819-3671/ablvq) to LOW for the following components and services: ■ ■ ■ 2 JVM Web Container Thread Pool Follow the instructions in the Admin Console online help to perform the following tasks: a. Configure call flow monitoring. b. View monitoring data. c. Configure the log level of the web container. d. View the server log. Module 3 • Deploying an Application and Monitoring the Application Server 21 22 4 M O D U L E 4 Extending the Application Server Through the Update Center Objectives Learn how to use the Update Center to extend the Application Server. 23 Adding the Java EE 5 Samples Module to the Application Server Through the Update Center Adding the Java EE 5 Samples Module to the Application Server Through the Update Center The objectives of this exercise are as follows: ■ ■ To teach you how to extend the Application Server through the Update Center To add the Java EE 5 Samples module in preparation for a future lab session Summary In this exercise, you will use the Update Center to add the Java EE 5 Samples module to your installation of the Application Server. 24 Getting Started With Sun Java System Application Server 9.1 Update 2 • August 2008 Adding the Java EE 5 Samples Module to the Application Server Through the Update Center To Add the Java EE 5 Samples Module to the Application Server Through the Update Center 1 Follow the instructions in Using the Application Server Update Center (http://docs.sun.com/doc/820-3530/gewof) in Sun Java System Application Server 9.1 Update 1-9.1 Update 2 Release Notes to enable the Update Center to check for updates every Tuesday at 3 PM. 2 In the Update Center window, click Help. 3 Follow the instructions in the Update Center online help to install the Java EE 5 Samples module. Module 4 • Extending the Application Server Through the Update Center 25 26 5 M O D U L E 5 Resources for Using Application Server Objectives Understand where to find information about how to use Sun Java System Application Server 9.1 Update 2. 27 Sources of Information Sources of Information Application Server product documentation: ■ Sun Java System Application Server 9.1 Update 1-9.1 Update 2 manuals: ■ ■ Manual title listing (http://docs.sun.com/coll/1343.5) Topic listing (http://docs.sun.com/doc/819-3668/fxiwa) ■ Admin Console GUI online help ■ Inline help and system text ■ CLI help ■ Introductory pages that are bundled with the product: ■ ■ ■ ■ index.html (http://localhost:8080) as-install/docs/about.html as-install/docs/features.html as-install/docs/QuickStart.html Additional resources: ■ ■ 28 GlassFish User FAQ (http://wiki.glassfish.java.net/Wiki.jsp?page=GlassFishUserFAQ) GlassFish Developer FAQ (http://wiki.glassfish.java.net/ Wiki.jsp?page=GlassFishDeveloperFAQ) Getting Started With Sun Java System Application Server 9.1 Update 2 • August 2008