Maintaining the J2EE application on the server
This exercise shows you how to start, stop, and uninstall the application from the server. In addition, you learn some problem determination techniques.
Managing the application on the server
Suppose a month has passed and the due date of the prize giveaway has approached. It's time to stop the HelloWorld application from running on the server as your company is no longer accepting contestant entries. To stop the application on the server, you need to use the WebSphere administrative console. The workbench is integrated with the WebSphere administrative console.
- In the Servers view, right-click the server and select Run Administrative Console. The Administrative Client logon window opens in the Web Browser view.
Alternatively, open the administrative console in a Web browser by specifying http://localhost:9060/ibm/console/in the address bar.
- Specify any text for the user ID as it is used for logging purposes when the server is not secured. Click Log In.
Figure 32. The WebSphere Administrative Console
- On the left pane, select Applications > Enterprise Applications. The Enterprise Applications page opens.
- Place a check mark beside HelloWorldEAR and click Stop. The status of the HelloWorldEAR application changes to the
stop icon.
Figure 33. Stopping an application in WebSphere Administrative Console
-
Open a new Web browser and in the address bar specify:
http://<hostname>:9080/PrizeRegistration/index.jsp
where, <hostname> is the name of the machine where you are running the server. An error404: FileNotFoundExceptionis displayed. - Congratulations, you have successfully stopped the application from running on the server.
- Specify any text for the user ID as it is used for logging purposes when the server is not secured. Click Log In.
- If your manager decides to extend the promotional giveaway, allowing for more contestant entries past the due date, repeat the preceding steps and select Start to restart the application on the server.
- If your manager decides that the promotional giveaway will no longer continue, select Uninstall to remove the application from the installedApps directory of the external server.
- Logout and close the WebSphere administrative console.
Troubleshooting and problem determination
- The WebSphere Application Server generates many log files that assist in problem determination. All WebSphere Application Server log files are under the WAS_INSTALL_ROOT/profile/log directory, where WAS_INSTALL_ROOT/profile is the directory of your profile for the WebSphere Application Server. For example, C:\Program Files\IBM\WebSphere\AppServer\profiles\AppSrv01\logs directory. The following table describes some of the main log files available for troubleshooting the server:
Log file Description SystemOut.log Standard JVM output log that indicates if code running in the server started and stopped successfully. SystemErr.log Standard JVM error log that contain exceptions thrown by code running in the server. startServer.log Logs the startup of the server. If the server has successfully started, the last two lines of this log file read:
Server launched. Waiting for initialization status.
Server server1 open for e-business; process id is 1932.stopServer.log Logs the shutdown of the server. If the server has successfully stopped, the last two lines of this log file read:
Server stop request issued. Waiting for stop status.
Server server1 stop completed.activity.log A binary file that logs events that show a history of activities. A Log Analyzer tool is available to read the output from this file.
- In WebSphere Application Server Toolkit , you might have noticed that most of the messages in these log files were written in the Console view during the runtime of the server.
- Interpreting log messages. A WebSphere Application Server log entry has the following format:
Time Stamp Thread Id Component Message Type Message Reference Message Description [8/16/06 9:37:20:380 EDT] 0000000a WsServerImpl A WSVR0001I Server server1 open for e-business
Time Stamp: The timestamp is formatted using the locale of the process where it is formatted. It includes a fully qualified date (YYMMDD), 24-hour time with millisecond precision, and the time zone.
Thread Id: An 8-character hexadecimal value generated from the hash code of the thread that issued the trace event.
Component: The abbreviated name of the logging component that issued the log event. This is typically the class name for WebSphere Application Server internal components, but might be some other identifier for user applications.
Message Type: A one-character field that indicates the type of the log event:
> Entry to a method < Exit a method A Audit W Warning X Error E Event D Debug T Terminate (exits process) F Fatal (exits process) I Information O Program output
Message Reference: The message identifier can be either 8 or 9 characters in length and has the form, for example, CCCC1234X, where CCCC is a four-character alphabetic component or application identifier, 1234 is a four-character numeric identifier used to identify the specific message for that component, and X is an optional alphabetic severity indicator (I=Informational, W=Warning, E=Error). For details on the message reference on a particular message identifier, search on the message identifier in the WebSphere Information Center.
Message Description: The message output issued.


