• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Websphere 8 not using welcome-file or running servlet referenced in web.xml

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am new to both JSP and Websphere and I could use your assistance. When I enter the following URL's on my local machine using either Tomcat or WebSphere Application Server Liberty with Eclipse I receive the expected results:

Tomcat: http://myserver:8080/LH_Up/
WAS: http://myserver:9080/LH_Up/

When I create and install the EAR file in Websphere on the production server and enter the URL below I receive the following message:

http://prodserver:9080/LH_Up/

Not Found

The requested URL /LH_Up/ was not found on this server.

IBM_HTTP_Server at prodserver Port 9080

However when I enter:

http://prodserver:9080/LH_Up/index.jsp

I receive the expected results.

I also receive the same message when I reference a servlet:
http://prodserver:9080/LH_Up/progress

Again, locally when I use http://myserver:8080/LH_Up/progress or http://myserver:9080/LH_Up/progress I receive the expected results.

It seems that the web.xml file is being ignored completely in Websphere on the production server. The web.xml file located in the folder WEB-INF. Below is my web.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="3.0" xmlns="http://java.sun.com/xml/ns/javaee";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">;
<servlet-name>ProgressServlet</servlet-name>
<servlet-class>test.ProgressServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ProgressServlet</servlet-name>
<url-pattern>/progress</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>

Any help would be greatly appreciated.

Thanks,
Greg
 
Rancher
Posts: 3645
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Go to your production server and check real DD via:

Applications > Application Types > WebSphere enterprise applications > application_name > Manage modules > module_name > View deployment descriptor
 
Greg Castle
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply. I checked the actual Deployment Descriptor shown below. This is basically the same as web.xml with the addition of <enabled> True</enabled> and <async-supported> False</async-supported>:


<web-app id="WebApp_ID" version="3.0" metadata-complete="false" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"; >
<servlet>
<servlet-name> ProgressServlet</servlet-name>
<servlet-class> test.ProgressServlet</servlet-class>
<enabled> True</enabled>
<async-supported> False</async-supported>
</servlet>
<servlet-mapping>
<servlet-name> ProgressServlet</servlet-name>
<url-pattern> /progress</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file> index.jsp</welcome-file>
</welcome-file-list>
</web-app>

Any other thoughts?
 
Mikalai Zaikin
Rancher
Posts: 3645
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What about a space character before index.jsp ?

 
Greg Castle
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately adding a space character before index.jsp did not solve the problem. Any other thoughts? Thanks, Greg
 
Mikalai Zaikin
Rancher
Posts: 3645
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Greg Castle wrote:Unfortunately adding a space character before index.jsp did not solve the problem. Any other thoughts? Thanks, Greg



Your web.xml had space before index.jsp, I wondered if it's the problem. In other words, remove all spaces before index.jsp, do not add ;-)
 
Greg Castle
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually there were no spaces. The display from the WebSphere console displayed Expand All and Collapse All options that showed spaces but the original web.xml did not contain any spaces. Being new to WebSphere, I've hit a real roadblock. Any other thoughts?

Thanks
 
Greg Castle
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
WebSphere is now using the welcome-file and running servlets as expected. Our WebSphere system was set up with two servers types: IIS and IBM HTTP Server and one cluster. Under Manage Modules, when both servers and the cluster are applied the application runs as expected. Any other combination things do not run properly. I thought I would only need to select the IBM HTTP Server and the one cluster, why do I need to choose IIS also? I will need to do some research in this area.

Thanks for all your help,

Greg
 
Mikalai Zaikin
Rancher
Posts: 3645
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Greg Castle wrote:WebSphere is now using the welcome-file and running servlets as expected. Our WebSphere system was set up with two servers types: IIS and IBM HTTP Server and one cluster. Under Manage Modules, when both servers and the cluster are applied the application runs as expected. Any other combination things do not run properly. I thought I would only need to select the IBM HTTP Server and the one cluster, why do I need to choose IIS also? I will need to do some research in this area.

Thanks for all your help,

Greg



Some thoughts:

1) Yes, after your replies about no-spaces in web.xml I started thinking that something else conflicting. But I would not expect that it's external application, I was looking for some conflicting mappings and your web.xml does not have them - pretty basic.

2) IIS can be used in front of WAS, like IHS. WAS supports several external web servers for a) static content deployment b) for collaborating with web-plugin and work load management in cluster. In your case, I'm not sure why is such topology is. In any case - you *must* update plugin config whenever something changed in the applications (new application deployed, new servlets added)

3) You mentioned port 9080 on your prod server, and this is default WAS HTTP port, IHS or IIS usually listen for port 80. It's really confusing...

4) If IIS really intercepts direct request to context root (without index.jsp), it must show 404 error in its logs (I'd suggest to regenerate plugin config and propagate to IHS web plugin in this case).
 
You have to be odd to be #1 - Seuss. An odd little ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic