Books: Websphere Application Server V6: Web Container Problem Determination
Books: Websphere Application Server V6: Web Container Problem Determination
Books: Websphere Application Server V6: Web Container Problem Determination
Javier Voos
Problems areas that are related to the Web container also include session
management problems and character encoding problems.
Figure 1 illustrates the Web container and its place within the application server.
Application Server
Web container
Web
browser
client HTTP server HTTP(s)
Web Container
inbound chain
WebSphere
plug-in
Session Manager
Servlet JSP
EJB Container
JCA Services
Security Server
Messaging
Web Services
Web applications
Servlets and JavaServer™ Pages™ (JSP) files are referred to as Web
components. Static content files (such as HTML pages, image files, and XML
files) are bundled with Web components during application assembly to create a
Web module. A Web module is the single deployable and usable unit of Web
resources and has a specific structure or archived format known as a Web
archive (WAR) file. A J2EE™ Web module corresponds to a Web application as
defined in the Java™ Servlet specification.
The top-level directory of a Web module is the document root of the application.
The document root is where JSP pages and static Web resources are stored.
The document root contains a subdirectory named /WEB-INF/, which contains
the Web application deployment descriptor (web.xml) and the server-side
classes used by the module.
Initial symptoms
A problem that occurs in the Web container usually causes unexpected results to
be displayed in the Web browser. Three common indications are addressed
here:
HTTP 404 errors
HTTP 500 errors
Incorrect information
Note: If the application has an error page configured in the Web module to be
delivered when HTTP errors occur, the user will see this page instead of an
HTTP error page. In this case, the true error might not be apparent until the
Web server log files are examined.
Figure 3 on page 5 shows a flow chart of the high-level symptoms and the
potential problem areas that might apply to each.
Static resource
Next, you go through a series of questions and actions that will help you define
the high-level symptoms that you are experiencing. Each of these steps leads
you to a more detailed procedure that takes you through the process of collecting
and analyzing data to determine the most likely source of the problem.
And lastly, we provide guidance on the next step to take for resolution, whether it
be a support site, contacting IBM®, information about configuration, or some
other suggestion as to how to proceed.
Data to collect
The following data will help you with the problem determination process in a Web
container execution environment:
WebSphere® Application Server JVM logs: SystemOut and SystemErr files
WebSphere Application Server process logs: native_stderr.log and
native_stdout.log log files
Web server log files
The Web server log files names and locations are specific to the product (IBM
HTTP Server, Apache, SunOne, IIS, and Domino®) that is used for this function.
When an HTTP error occurs, the Web browser displays the error page with the
error code (in particular, HTTP error codes 404 and 500 are likely). If a custom
error page has been configured for the Web module, you need check the Web
server logs files to determine the specific HTTP error code.
Page can’t be found or displayed “Symptom: HTTP 404 error - The page
cannot be displayed” on page 8
JSPG0036E: Failed to find resource “Symptom: HTTP 404 error - Failed to find
message resource” on page 11
no
Web Module starts sucessfully? Review JVM logs problems
yes
no
Web Server OK? HTTP Server support
yes
no
no
You can look up the extended error definitions in the session manager
message table:
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/
com.ibm.websphere.messages.doc/doc/SESN.html
If you find a session manager error but the explanation is not sufficient to solve
the problem, go to “The next step” on page 45.
If the Web server Welcome page does not appear (that is, if you get a browser
message such as page cannot be displayed or something similar), the problem is
most likely in the Web server. For information about how to approach Web server
problems, see Approach to Problem Determination in WebSphere Application
Server V6 at:
http://www.redbooks.ibm.com/redpapers/pdfs/redp4073.pdf
If you have regenerated the plug-in and are sure it is in use but still have a
problem, you can bypass the Web server and access the application directly
Note: To access the application directly through the Web container, do the
following:
1. Find the port for the Web container:
a. In the WebSphere administrative console, select Servers →
Application Servers.
b. Select the server name.
c. Under the Communications section, expand Ports.
d. Use the port number listed for WC_defaulthost.
2. Use the port number to access the resource from a browser. For example,
if the port is 9080, the URL is:
http://hostname:9080/myAppContext/myJSP.jsp
If you can access the application via the application server but not through the
Web server, you are most likely experiencing a problem with the Web server
plug-in. In this case, consult WebSphere Application Server V6: Web Server
Plug-in Problem Determination at:
http://www.redbooks.ibm.com/redpapers/pdfs/redp4045.pdf
If the searches fail to find the problem, then go to “The next step” on page 45 for
information about gathering the MustGather documentation for HTTP status
code 404 “Not Found” problems.
If the URL is incorrect and is being created as a link from another JSP file,
servlet, or HTML file, try correcting it in the browser URL field and reloading the
page. This ensures that you know the correct URL before updating the
application to use it.
If the URL appears to be correct, it is possible that this page does not exist in the
Web module deployment unit (WAR file). Verify that the requested page is
located in the Web module directory structure:
<WAS_install_root>/profiles/<profile>/installedApps/<node>/
<application>.ear\<web module>.war
<VirtualHostGroup Name="test_host">
<VirtualHost Name="test:80"/>
<VirtualHost Name="*:9081"/>
</VirtualHostGroup>
If localhost is used as an alias entry, check the etc/hosts file to ensure that all
host names (aliases) associated with the loop back address (127.0.0.1) are
part of the same virtual host grouping (for example, default_host).
Note: The virtual host matching that is performed by the application server is
case sensitive. For example, if your virtual host alias is listed as myserver:80,
a request to http://MYSERVER:80/snoop results in the following message in
the browser:
SRVE0017W: A WebGroup/Virtual Host to handle MYSERVER:80 has not been
defined.
Favicon.ico reference
When accessing the WebSphere administrative console, you could see an error
similar to the following:
Servlet Request Processor Exception: Virtual Host/WebGroup Not Found : The web
group /favicon.ico has not been defined.
If you receive this error message, refer to Technote # 1193379 at the following
Web address for the cause and solution details:
http://www.ibm.com/support/docview.wss?uid=swg21193379
If your searches fail to find the problem, then go to “The next step” on page 45 for
information about gathering the MustGather documentation for servlet engine
and Web container problems.
no
HTML or servlet displays correctly HTTP 404 - Page not found steps
yes
no
JSP Processor starts normally
yes
Look at available online support
JSP code revision
problem continues
IBM Support Help
If the JSP processor fails to load, go to “The next step” on page 45 for information
about gathering the MustGather documentation for JSP exceptions.
Examine the SystemOut.log file for problems with invalid Java syntax. Errors
that contain text similar to “failed to compile (shown in Example 6) indicate
this kind of problem.
If the searches fail to resolve your problem, go to “The next step” on page 45 for
information about gathering the MustGather documentation for JSP exceptions.
When a session terminates, the session object and the information that is stored
in it are lost permanently. The session manager unbinds any objects bound to the
session before it destroys the session.
Check the servlet or JSP code that threw the exception to make sure the session
is not being invalidated too early. If that is not the case, check the session
timeout interval to ensure it is not too short.
For current information that is available from IBM Support on known problems
and their resolution related to session management, use the following URL:
http://www.ibm.com/support/search.wss?rs=180&tc=SSEQTP&tc1=SSCMPDS&rankprofile=
8&dc=DB520+D800+D900+DA900+DA800&dtm
If these actions do not identify the problem, go to “The next step” on page 45 for
information about gathering the MustGather documentation for session and
session management problems.
No
Response already committed ? Display page in browser Response already committed ?
Yes
For current information that is available from IBM Support on known issues and
resolutions that related to session management, go to the following URL:
http://www.ibm.com/support/search.wss?rs=180&tc=SSEQTP&tc1=SSCMPDF&rankprofile=
8&dc=DB520+D800+D900+DA900+DA800&dtm
If these steps do not resolve your problem, go to “The next step” on page 45 for
information about gathering the MustGather documentation for servlet engine
and Web container problems.
Finding <host>:<port>
When a Web module is installed, a virtual host is associated with it. To find the
virtual host using the WebSphere administrative console:
1. Select Applications → Enterprise Applications.
2. Select the application name to open the details page.
3. In the Additional Properties section, click Map virtual hosts for Web
modules.
4. Note the virtual host(s) that are used by the specified application Web
module, as shown in Figure 9.
Figure 10 Finding the alias and ports for the virtual host
Finding <context_root>
The context root is the Web application root and is used to identify the application
in the URI. To find the context root:
1. In the WebSphere administrative console, click Applications → Enterprise
Applications.
2. Select the target application, then under Additional Properties, click View
Deployment Descriptor.
3. Review the <context-root> tag for the specified Web module in the related
deployment descriptor tag (Figure 11).
Finding <resource_name>
To find the initial file for the application (for example, index.html), you can look at
the welcome file list in the Web deployment descriptor. If you are looking for a
particular servlet, the servlet mappings in the Web deployment descriptor tell you
the URL pattern to use for each servlet. To find the initial file:
1. In the administrative console, click Applications → Enterprise
Applications.
2. Select the target application, and then under Related Items, click Web
modules.
3. Choose the specified Web module, and then under Additional Properties,
click View Deployment Descriptor.
4. Examine the <servlet-mapping id> and <welcome-file-list> deployment
descriptor tags to determine the URL pattern and file name configured
respectively for this purpose (Example 9).
5. If the Web module has security configured, also you need check the
<security-constraint> and <security-role> deployment descriptor tags for the
role that is needed for access to the selected Web resource (Example 10 on
page 26).
If the image files are in a subdirectory of the document root, verify that the
reference to the image reflects that, as shown in Example 11.
JSP files can be translated and compiled at runtime when the JSP file or its
dependencies are modified. This is known as JSP reloading. JSP reloading is
enabled through the reloadEnabled JSP engine parameter in the
ibm-web-ext.xmi configuration file.
For more available JSP attributes and details that are related to reload
processing sequence, see the following article in the WebSphere Information
Center:
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/
com.ibm.websphere.base.doc/info/aes/ae/rweb_jspreloading.html
Double Byte Character Set (DBCS) character processing is a common issue for
encoding problems. DBCS is used for languages such a Chinese, Korean, and
Japanese, where a single byte is not sufficient to represent all characters in the
alphabet. Proper coding and configuration usually resolves these problems
req.setCharacterEncoding("UTF-8");
String name = req.getParameter("name");
resp.setContentType("text/html;charset=UTF-8");
PrintWriter out = resp.getWriter();
out.println("<html><body><h1>");
out.println("Your name is "+name);
out.println("</h1></body></html>");
}
}
You must call the method before parsing any request parameters or reading any
input from the request. Calling the method or tag after data has been read will not
affect the encoding.
Page encoding
For JSP pages, page encoding is the character encoding in which the file is
encoded. For JSP pages in standard syntax, the page encoding is determined
from the following sources:
The pageEncoding attribute of the page directive of the page
The charset value of the contentType attribute of the page directive
Response encoding
Response encoding is character encoding of the textual response that is
generated from a Web component. A Web container sets an initial response
encoding for a JSP page from the following sources:
The charset value of the contentType attribute of the page directive
The encoding specified by the pageEncoding attribute of the page directive
Use an assembly tool (Figure 12 on page 28) to change the default values for the
autoRequestEncoding and autoResponseEncoding extensions.
setCharacterEncoding() contextType
autoRequestEncoding
procedure
setContextType() pageEncoding
autoResponseEncoding
procedure
If these steps do not resolve your problem, go to “The next step” on page 45 for
information about gathering the MustGather documentation for
internationalization problems.
When session data is lost between requests, the session manager configuration
settings are the most likely suspect.
It can be invoked from any Web module that is enabled to serve servlets by
class name using the following URL:
http://localhost:9080/servlet/com.ibm.ws.webcontainer.httpsession.
IBMTrackerDebug
Note that a module that can be viewed via the serve servlets by classname
feature can be seen by anyone that can view the application. You might want
to map a specific, secured URL to the servlet instead and disable serve
servlets by classname.
When you configure session management at the Web container level, all
applications and the respective Web modules in the Web container normally
inherit that configuration, setting up a basic default configuration for the
applications and Web modules below it. However, you can set up different
configurations individually for specific applications and Web modules that vary
from the Web container default. These different configurations override the
default for these applications and Web modules only.
Note: When you overwrite the default session management settings on the
application level, all the Web modules below that application inherit this new
setting, unless they too are set to overwrite these settings.
To begin session management configuration, you first need to get to the settings
for the selected level.
1. Web container level:
a. In the WebSphere administrative console, click Servers → Application
servers.
b. Select the application server name.
Note: If you are working on the Web module or application level and want
these settings to override the inherited Session Management settings, under
General Properties, select Override session management.
If you are having session management problems, there are specific things to
check for each type of session manager tracking. In addition, the following
configuration items are common to all three tracking types:
Session timeout interval
Database persistent session
To view or change the cookie settings, click the Enable cookies link.
If you use a Netscape browser, check the following URL for information
related to cookie domains that are not recognized with Netscape:
http://www.ibm.com/support/docview.wss?uid=swg21163880
Check the cookie domain definition (see Example 18).
Check the cookie path that is specified in the session manager settings.
Check whether the problem URL is hierarchically below the cookie path that
is specified. If it is not, correct the cookie path.
If the cookie maximum age property is set, ensure that the client (browser)
machine's date and time is the same as the server's, including the time zone.
If the client and the server time difference is over the maximum age, every
access would be a new session because the cookie will expire after the
access.
If you have multiple Web modules within an enterprise application that track
sessions:
– If you want to have different session settings among Web modules in an
enterprise application, ensure that each Web module specifies a different
cookie name or path.
– If Web modules within an enterprise application use a common cookie
name and path, ensure that the HTTP session settings, such as cookie
maximum age, are the same for all Web modules. Otherwise, cookie
behavior is unpredictable and depends upon which application creates the
session. Note that this does not affect session data, which is maintained
separately by the Web module.
Configure Internet browsers to present a warning before accepting cookies:
http://www.ibm.com/support/docview.wss?uid=swg21157880
Enabling protocol switch rewriting specifies that the session ID is added to a URL
when the URL requires a switch from HTTP to HTTPS or from HTTPS to HTTP.
If rewriting is enabled, the session ID is required to go between HTTP and
HTTPS.
You can check if URL rewriting is enabled by going to the appropriate session
management configuration level and verifying that the Enable URL rewriting
option is selected. You can also see if Enable protocol switch rewriting
option is selected.
Note: You should check these settings against the properties of an existing
data source. The session manager does not create a session database
automatically for you.
For current information available from IBM Support on known issues and
resolutions that are related to session management, see:
http://www.ibm.com/support/search.wss?rs=180&tc=SSEQTP&tc1=SSCMPDS&rankprofile=
8&dc=DB520+D800+D900+DA900+DA800&dtm
If these steps do not resolve your problem, go to the next section for information
about gathering the MustGather documentation for session management
problems.
If, after going through this process, you still have an undiagnosed problem, it is
recommended that you go back to Approach to Problem Determination in
WebSphere Application Server V6 at:
http://www.redbooks.ibm.com/redpapers/pdfs/redp4073.pdf
Review the problem classifications to see if there are any other components that
might be causing the problem.
If you feel sure that you have a Web container related problem, there are things
you can do before contacting IBM support. First, you should review the
documentation that you have gathered for errors related to the Web container
that were not addressed in this paper and search support sites for information or
fixes. For hints and tips, technotes, and fixes that are related to Web container
problems, see:
http://www.ibm.com/support/search.wss?rs=180&tc=SSEQTP&tc1=SSCMPDF
If the problem is performance related, the following references are useful for
configuring the JSP engine for optimal performance:
JSP engine configuration parameters
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/
com.ibm.websphere.base.doc/info/aes/ae/rweb_jspengine.html
JSP class file generation
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/
com.ibm.websphere.base.doc/info/aes/ae/cweb_jspclassfiles.html
Disabling JavaServer Pages run-time compilation
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/
com.ibm.websphere.base.doc/info/aes/ae/rweb_jspdis.html
Packages and directories for generated .java and .class files
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/
com.ibm.websphere.base.doc/info/aes/ae/cweb_javapkg.html
Be sure to note all of the diagnostic work that you have done so far to minimize
the amount of time that it takes IBM Support to assist you in resolving your
problem.
You can find detailed information about contacting IBM support for issues that
are related to WebSphere Application Server V6.0 in Approach to Problem
Determination in WebSphere Application Server V6 at:
http://www.redbooks.ibm.com/redpapers/pdfs/redp4073.pdf
This information was developed for products and services offered in the U.S.A.
IBM may not offer the products, services, or features discussed in this document in other countries. Consult
your local IBM representative for information on the products and services currently available in your area.
Any reference to an IBM product, program, or service is not intended to state or imply that only that IBM
product, program, or service may be used. Any functionally equivalent product, program, or service that
does not infringe any IBM intellectual property right may be used instead. However, it is the user's
responsibility to evaluate and verify the operation of any non-IBM product, program, or service.
IBM may have patents or pending patent applications covering subject matter described in this document.
The furnishing of this document does not give you any license to these patents. You can send license
inquiries, in writing, to:
IBM Director of Licensing, IBM Corporation, North Castle Drive Armonk, NY 10504-1785 U.S.A.
The following paragraph does not apply to the United Kingdom or any other country where such
provisions are inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION
PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT,
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer
of express or implied warranties in certain transactions, therefore, this statement may not apply to you.
This information could include technical inaccuracies or typographical errors. Changes are periodically made
to the information herein; these changes will be incorporated in new editions of the publication. IBM may
make improvements and/or changes in the product(s) and/or the program(s) described in this publication at
any time without notice.
Any references in this information to non-IBM Web sites are provided for convenience only and do not in any
manner serve as an endorsement of those Web sites. The materials at those Web sites are not part of the
materials for this IBM product and use of those Web sites is at your own risk.
IBM may use or distribute any of the information you supply in any way it believes appropriate without
incurring any obligation to you.
Information concerning non-IBM products was obtained from the suppliers of those products, their published
announcements or other publicly available sources. IBM has not tested those products and cannot confirm
the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on
the capabilities of non-IBM products should be addressed to the suppliers of those products.
This information contains examples of data and reports used in daily business operations. To illustrate them
as completely as possible, the examples include the names of individuals, companies, brands, and products.
All of these names are fictitious and any similarity to the names and addresses used by an actual business
enterprise is entirely coincidental.
COPYRIGHT LICENSE:
This information contains sample application programs in source language, which illustrates programming
techniques on various operating platforms. You may copy, modify, and distribute these sample programs in
any form without payment to IBM, for the purposes of developing, using, marketing or distributing application
programs conforming to the application programming interface for the operating platform for which the
sample programs are written. These examples have not been thoroughly tested under all conditions. IBM,
therefore, cannot guarantee or imply reliability, serviceability, or function of these programs. You may copy,
modify, and distribute these sample programs in any form without payment to IBM for the purposes of
developing, using, marketing, or distributing application programs conforming to IBM's application
programming interfaces.
Trademarks
The following terms are trademarks of the International Business Machines Corporation in the United States,
other countries, or both:
iPlanet, Java, JavaServer, JavaServer Pages, JSP, JVM, J2EE, and all Java-based trademarks are
trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.
Other company, product, or service names may be trademarks or service marks of others.