Friday, October 29, 2010

WebGroup / virtual host not defined error in WebSphere

When you have a “WebGroup / virtual host not defined” error what to do?

If we find in log file can see this error:
PLGN0021E: Servlet Request Processor Exception: Virtual Host/WebGroup Not Found : The host xxxxxxx has not been defined.

Access application from app server: By pass the web server and access the application directly from the application server using app_server_name:port/context_root
Check any recent application install/update: If you have recently updated or installed the application, ensure that the Web server plug-in was regenerated and propagated to the Web server. Also, ensure
that the Web server is using the new plug-in configuration file.
Verify Plug-in is working: Attempt to access other applications running on the same application server through the Web server. If you can access another application, this will verify that the plug-in and Web server are working with the application server, but not necessarily that the plug-in configuration is correct.
Verify Virtual Host/ Host Alias etc..
Verify that the virtual host associated with the Web module has a host alias defined containing the host name and port matching the host name and port in the URL causing the failure.
  1. Find the URL pattern for the servlet.
  2. Find the context root of the Web module containing the servlet.
  3. Find the virtual host where the Web module is installed.
  4. Find the aliases by which the virtual host is known.
After finding above four, check the following:
  • Combine the virtual host alias, context root and URL pattern to form the correct URL request for the servlet.
  • Compare the correct URL for the servlet with the URL reported in the problem.
  • If they are the same, verify the resource file exists in the deployed application.
  • If not, correct the application calling the resource.

If you don’t know how to check url pattern/context root/virtual host/host alias….follow these instructions
  • Finding URL pattern
1. In the administrative console, select Applications -> Enterprise Applications.
2. Click on the application name.
3. Select Manage Modules.
4. Click the WebModule_name Web application
5. Click View Deployment Descriptor.
Look for the servlet in a <servlet-mapping> entry and note the url-pattern value.
Note: If the Web module has security configured, check the <security-constraint> and <security-role> deployment descriptor tags for the role that is needed for access to the selected Web resource.
  • Finding the context root of the web module
1. Select Applications ?Enterprise Applications.
2. Click on the application name.
3. Click on Context Root for Web Modules.
4. Note the context root for the appropriate Web module.
  • Finding the virtual host used for application
Find the virtual host where the Web module is installed:
1. Select Applications ?Enterprise Applications.
2. Click on the application name.
3. Click on Virtual hosts under Web Module Properties.
4. Note the virtual host for the Web module.
  • Finding the host aliases for the virtual host
1. From the console navigation tree, select Environment ?Virtual Hosts.
2. Click on the virtual host.
3. Select Host Aliases under Additional Properties.
An alias is composed of a host name and port number. Each alias represents a valid host:port combination for the Web module to be accessed from web server.

[9/28/09 22:23:29:538 EST] 00000040 SRTServletReq E SRVE0133E: An error occurred while parsing parameters. java.net.SocketTimeoutException: Async operation timed out

[9/28/09 22:23:29:538 EST] 00000040 SRTServletReq E   SRVE0133E: An error occurred while parsing parameters. java.net.SocketTimeoutException: Async operation timed out
Explanation:

As you can see this error will originate from Web Container’s http transport channel. And the reason for this error to come is Network delay. By default, in WebSphere application server, ConnectionTimeout will be set to 5 seconds for http transport channels. So if your network is slow, you may see this error in the logs

If you would like to change this timeout settings, follow these steps:

  • Application Servers -> serverA -> Web Container -> HTTP Transport -> Application Name
  • go to custom properties
  • Add these two parameters (where xx is the time in seconds)
  • ConnectionIOTimeOut=xx and ConnectionKeepAliveTimeout=xx
  • Repeat this for all servers, if your application is mapped to multiple servers.
  • Restart the server (s)