This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Websphere and the fly likes New Virtual Host Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "New Virtual Host" Watch "New Virtual Host" New topic
Author

New Virtual Host

Michael Zalewski
Ranch Hand

Joined: Apr 23, 2002
Posts: 168
I am trying to set up a site in Websphere 4.0 / IIS 5.0 / Windows 2000.
I want to make a virtual host for my site, so that my pages can be accessed URLs like
<pre>http://my.virtual.host/mypage.jsp</pre>
The images are at URLs like
<pre>http://my.virtual.host/Images/myimage.gif</pre>
The servlet is a control servlet accessed at
<pre>http://my.virtual.host/servlet/MyServlet/..extra stuff..</pre>
I have built this all into a .war file, and deployed it. Everything works fine except
1) The welcome file (which is called Login.jsp) is not recognized. The request goes back to IIS, which gives a 'Under Construction' message. However, if you type the full URL as <pre>http://my.virtual.host/Login.jsp</pre> it works.
2) The images don't work. Again, the request goes back to IIS. So I can make the images work by setting up a virtual host in IIS called Images, and mapping it to d:\WebSphere\AppServer\installedApps\myApp.ear\myApp.war\Images (which I don't want to do)
What am I doing rong?
[ November 21, 2002: Message edited by: Michael Zalewski ]
[ November 21, 2002: Message edited by: Michael Zalewski ]
David Hibbs
Ranch Hand

Joined: Dec 19, 2002
Posts: 374
You're going to love this...
We just moved our first batch of J2EE code from WebSphere 3.5 to 4.0. As far as migrating the code, it went beautifully. As far as configuring WAS4.0, it didn't.
The problem? We discovered a "feature" of WAS 4.0.
It took 4+ hours to figure out what was going on, too, not including the isolation of "it's the virtual hosts." Google came up short. Sun.com and JavaRanch came up short. Public IBM pages? get real--have you tried finding stuff there?!?!
When I finally managed to get logged into their support section, I ran a number of searches and finally found the key.
You can't use a jsp as a welcome file if you have a virtual host configured with a context root of "/".
Heaven forbid a J2EE developer should ever want to run on a virtual host and have a JSP as the primary page. I can't imagine why I ever even tried it! Sheesh. To quote the IBM support page:

This is really "working as designed".
PQ54168.RN was created in addition to WAS V4.0.2 Release Notes.
The plugin is working as designed in the sense that the rule in the plugin-cfg.xml config file of "*.jsp" should match the request "/path/index.jsp".
Based on the logic defined of the config file, it is not hitting the "wrong" app. The plugin can't know that any specific request should be ignored, even though it is defined by the *.jsp rule. Customer should use the solution below to enable functionality they are requesting which his to enable WAS to serve all content, bypassing the webserver.

As designed. Pfeh. Why on Earth anyone would DESIGN this is beyond me.
Anyway, the fix is as follows:
1. Define a servlet via AAT using the following information, class name = com.ibm.servlet.engine.webapp.SimpleFileServlet uri = /
2. Redeploy the ear file
3. Regenerate the plugins
Note: This only needs to be done if want to use the file serving enabler for context root of "/". For example, http://www.mydomain.com/index.html

Oh, and for those of you with support contracts, the page is at
http://www-1.ibm.com/support/entdocview.wss?rs=0&context=SW600&q=host%2Bvirtual&uid=swg21063540
Heaven help you get a connection and get validated, but there ya go.
[ December 19, 2002: Message edited by: David Hibbs ]

"Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The JavaPerformanceTuning.com team, Newsletter 039.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: New Virtual Host
 
Similar Threads
IBM HttpServer and websphere Appserver
logout
How to deploy a simple Web App with no EJB
newbie in jsp
localhost missing to the WebsPhere