Since the application server is not automatically started during installation, you need to start the application server environment and verify that it is running properly before deploying and exercising the sample application. Before starting the application server, you will first be introduced to the Administrative Domains feature and then given a brief overview of the processes that make up an application server environment.
Administrative DomainsSun ONE Application Server 7 introduces a feature named Administrative Domains that enables you to define multiple, completely separate application server runtime configurations that reuse the same installation image. Each administrative domain is represented by an administrative server which in turn controls one or more application server instances. The configuration of an administrative domain can reside anywhere on the machine. Although developers using their own workstations will likely use a single administrative domain for day-to-day development, both shared development servers and operational environments will greatly benefit from using multiple administrative domains. On shared development servers, creation of an administrative domain for each developer provides a compartmentalized area or "sandbox" for each developer on a shared server machine. In operational environments, administrative domains enable systems administrators to define separate secure runtime configurations without requiring multiple installations of the product. In the following exercises you will be working with a single administrative
domain that has been either preconfigured during installation of the product
or configured as a post installation task after the application server
has been installed as part of a Solaris 9 installation. Application Server ProcessesBefore starting the application server, take a few moments to familiarize yourself with the processes that will be running behind the scenes in each administrative domain.
Application Server Daemon The Application Server Daemon process, appservd, forms the core of the application server runtime. It houses the embedded HTTP Server, ORB, J2EE[tm] Containers and supporting subsystems such as the Transaction Manager and Persistence Managers. Each appservd process houses a Java[tm] Virtual Machine (JVM[tm]). In each administrative domain, there is an appservd process that houses the administrative server for the domain. This process is referred to as the Administrative Server Instance. The administrative server controls and manages a number of additional appservd processes that represent individual application server instances.
Application Server Watchdog The Application Server Watchdog processes, appservd-wdog, are native language processes monitor the application server daemon processes. In case of a daemon failure, the companion watchdog restarts the failed application server daemon process. Each application server daemon has a companion watchdog process. Message Queue Broker By default, each application server instance includes a companion Sun ONE Message Queue Message Broker process. The message broker process is the core of the Java Message Service (JMS) of the application server. Since there is only one application server instance created during installation, initially there is only a single message broker process started during application server startup. As you define new application server instances, new companion message broker processes are created automatically. After creating an application server instance, you have the option of disabling the companion message broker process to support cases in which your applications either do not use the Java Message Service (JMS) facilities or use a message service that is not part of the application server. Message Queue Broker Wrapper This process is simply a lightweight wrapper around the message broker process. The wrapper process manages restart of the message broker process. The relationships amongst the application server processes is depicted in the following diagram: Now that you have been introduced to the processes that make up an administrative domain, your next step is to learn about the installation directory structure prior to starting the application server. Installation Directory StructureDepending on the distribution used to install the application server product on your system, your application server installation may either be installed under a single root directory path or be spread across several root directory paths. Bundled Installation on Solaris 9 On Solaris, when using the Solaris package-based installation of the product and when installing the application server as part of a Solaris 9 installation, the application server installation is spread across several root directories. The application server included in a Solaris 9 installation is installed in the following locations:
Package-based Installation on Solaris 8 and 9 By default, when using the Solaris package-based installation of the application server, the installation locations are spread across three directory roots in a similar fashion to the bundled installation case.
Windows and Evaluation Installations On Windows, and in the case of installing the evaluation distribution of the application server without Solaris packages, the application server installation is rooted under a single directory path. For example:
In these cases, the config/ and domains/ directories are positioned under the installation directory root. Conventions for Referring to Directories This guide uses the following conventions when referring to key locations within an application server installation:
Tools for Starting and Stopping the Application ServerIn the following exercises, "starting" the application server entails starting the administrative server and the initially configured application server instance defined in the administrative domain. To start the application server, you can use any of the following facilities:
Using the Command LineOn all OS platforms, you can use the asadmin command line utility to start and stop the entire application server, a specific administrative domain and individual application server instances. In terms of start and stop operations, the following subcommands of asadmin are of interest:
Using start-domain and stop-domain If the application server is running, use the following command to start both the administrative server as well as the application server instance of the initially configured domain:
Where "domain1" is the name of the administrative domain defined during installation of the application server. As the command completes, you should observe the following results:
Likewise, you can stop the initially configured administrative domain by executing the following command:
As the command completes, you should observe the following results:
Since there is rarely a reason to start and stop the administrative server repeatedly in day-to-day operations of the application server, you are likely to use the instance level start and stop subcommands more frequently than the overall start|stop-domain commands. The next section introduces you to starting and stopping individual application server instances from the command line. Using start-instance and stop-instance To stop a specific application server instance without relying on the presence of an administrative server, you can use the following command:
where server1 is the name of the application server instance. If your environment contains more than one administrative domain, then you need to specify the administrative domain name when invoking the stop-instance command. For example:
To start a specific application server instance in local mode, you can use the following command:
If you wish to start or stop an instance on a remote system, you can specify the target administrative server and administrative user name and password on the start-instance and stop-instance commands. Execute either of these subcommands without parameters to see usage information. Alternatively, you can issues the subcommands followed by the --help option to obtain complete usage information.
After launching the processes, you can perform several other checks to determine whether or not the application server has started successfully. Normally, the successful startup message displayed in the application server's event log window is an indication of a proper startup. However, it is a useful initial exercise to try out several additional methods of checking the status of an application server startup. In addition to monitoring the server instance event log on the desktop, you can also use either of the following approaches to determine if the server started properly:
Accessing the Server Event Log Files Although the application server instance event log files are displayed on the desktop by default, the event log of the administrative server is not displayed to the desktop by default. Normally, you won't need to monitor the output of the administrative server. However, if you need to troubleshoot a problem, you can follow these instructions to access the administrative server's event log. 1. Using Windows Explorer, navigate to the area in which the administrative server's event log files are held:
2. Double click the file named server.log to open the file in an editor. You should find a "successful server startup" message at the end of the log file. If you don't see the startup successful message, you may have opened the event log file prior to the administrative server completing its startup procedures. Close the log file and open it again to see the very latest event messages. In day-to-day use of the application server, you will not need to constantly check to see if the administrative server has started successfully. Rather, you will be working primarily with application server instances that are the target of your J2EE development activities.
Although the application server instance event log files are displayed to the desktop by default, it is useful for you to know the location of these event log files. Navigate to the application server instance's log directory and open the server.log file:
As you open the application server instance's log file, you should see the same messages that appeared the event log window on the desktop.
Accessing HTTP Server of Application Server Instance A simple means of determining whether or not an application server instance has started is to access the instance's HTTP server listener through a web browser. After creation of a new application server instance, you will typically use this approach to quickly determine that the application server has started successfully. Using a browser, access the following location:
Where <port number> is the HTTP server port number specified during installation. The default HTTP server port number is 80, but it may be different based on the ports in use during installation.
If the application server instance is up and running normally, you should see the following default HTTP server welcome page in your browser:
In the next section, you will use the application server's administrative
console to start and stop the application server. Using the Administrative ConsoleAs long as the administrative server is running, you can also use the web-based administrative console to start and stop application server instances. 1. Start the Administrative Console
On Windows, the easiest means of starting the web-based administrative console is to simply use the Windows desktop to select:
After selecting Start Admin Console, a window of your default browser will be displayed with the appropriate location of the administrative server's console as set during installation of the product. On UNIX, open a browser window and specify the location of your the administrative server's console application. During installation, the default port number for the administrative server is set to 4848, if this port was already in user or you selected another port number, then specify that port number. For example:
2. Sign in to the administrative console using the administrative user name and password supplied during product installation.
Once you've authenticated successfully, the initial screen of the administrative console will appear:
3. Select the server1 node in order to access the start and stop functions. Note the status of the application server instance. It is either in a "running" or "not running" state. 4. Depending on the server instance's state, click either the Start or Stop button to either start or stop the application server instance. If you are accessing an application server instance running a UNIX system, you will also see a Restart button. If you are using a UNIX system, proceed to Becoming Familiar with the Sample Application for a brief introduction to the sample application prior to deploying and exercising it. If you are using Windows, review the following sections to see how to start the application server using Windows program groups and services. Using Windows Program Group ItemsOn Windows, the easiest means of starting the entire application server is to use the Start button on the Windows desktop. 1. Access the following program group item to start the application server:
After selecting Start Application Server, you will first see a command window in which the status of the startup process is displayed. A second command window also appears on your desktop. This command window is a read only representation of the application server instance's event log file content. It will remain on your desktop as long as the associated application server instance is running. As the initially configured server starts, you will see event messages appearing in the second command window. After a few seconds, you will see a message confirming that the server instance has started successfully:
The application server instance command window resembles the following image. Note the "server1" designation in the title of the window. This is the name of the application server instance.
2. As the application server is starting up, start the Windows Task Manager to see the processes as they complete their startup sequence. You do not need to perform this task in the course of your everyday interaction with the application server. This exercise is presented only to help you understand the behind the scenes operation of the application server. To start and view the Windows Task Manager, perform the following steps: 2a. Right-click an empty area of the taskbar, and then click Task Manager. You can also start Task Manager by either pressing CTRL+ALT+DELETE and then clicking Task Manager or by pressing CTRL+SHIFT+ESC. 2b. Once Task Manager starts, select the Processes tab to view all processes running on the system. 2c. Then click on the column title Image Name to sort the list of processes in alphabetical order. In the following window, note the six processes that make up the initially configured application server environment. To completely stop the application server, access the following program group item:
This action will stop both the administrative server and the configured application server instances.
In the next section you will be introduced to the use of Windows services as a means of starting the application server. Using Windows ServicesAfter installation of the application server, several Windows services are defined to enable you to control startup and shutdown of the administrative server and the initially defined "server1" application server instance. In this section you will use these services to control the application server processes. 1. From the Windows desktop, access Start -> Settings -> Control Panel. 2. As the Control Panel is displayed, double click Administrative Tools . 3. Double click Services to view the services installed on your system. 4. The complete list of services defined on your system is displayed. Scroll down to view the Sun Application Server entries. Note that there are separate Windows services for the administrative server and the initially configured application server instance ("server1"). As long as the administrative server and application server instance are still running from the previous exercises, the Status column of each service entry should be represented as "Started". 5. As an exercise, start the Windows Task Manager to view the currently executing processes on your system. 6. Within the Services window, select the Sun Application Server 7 Admin Server entry, right click, and select Stop. Now monitor the Task Manager Windows to see the underlying processes terminate. 7. Follow the same procedure for the application server instance named "server1". As you stop the "server1" application server instance, the event log window will disappear from the desktop. 8. Once the administrative server and application server instance have been stopped, start them again by using the Windows services. Instead of using the Stop command when right clicking on a service, use the Start command. You may find it useful initially to monitor the startup of the underlying processes via the Windows Task Manager. Note that the event log window for the "server1" application server instance appears on the desktop as soon as the corresponding service is started.
Proceed to Becoming Familiar with the Sample Application for a brief introduction to the sample application prior to deploying and exercising it. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||