This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi folks. I've been thrown in at the deep end. We have an application running on Websphere 3.5 - unfortunately the guy who developed it all has left the company, leaving no documentation of use.... We need to get the application up and running on 4.0, and that is my task. I've spent the last few weeks bumbling around, but with little success... I've used the AAT to assemble the application (without ever being 100% sure about what I was doing), and managed to get it up and running (ie. you can get to the first page, and it finds the correct Servlet when I press Enter), but am experiencing a few problems: .gif files not being found on the web pages (I included them when assembling the application). I've tried putting them everywhere, but they just don't get picked up. a file that is being access by a Java Class cannot be found (again, this file was included in the assembly). Any help would be greatly appreciated, either about these specific problems or general 3.5 -> 4.50 migration. Cheers
1) The .gif files not being loaded -- What is your 'root context' for your application? And what version of WAS are you using. If your root context is "/" and version is before 4.0.4, you may need to either upgrade or change your root context (or use the support page to find a work-around). 2) The file not being found -- Do you mean like a .properties file? In WAS 3.5, you used to set a 'Working Directory' on the Application Server page. You do the same in WAS 4.0, but the application server page is a little deeper down the tree. There is now a 'Application Servers' folder underneath the node, and your application should be listed there. Your Application Server has a 'Working Directory' property which you can set by navigating to the application server, then editting in the 'General' tab.
One further note about your .gifs. On 3.5 you could set the doc root to point to your image files and such. I think that as long as your images are in a directory relative to the context root, it should find them. If worst comes to worst, put them in the IBM HTTP Server/htdocs directory.
No more rhymes! I mean it!<br /> <br />Does anybody want a peanut?
Joined: Nov 25, 2002
Thanks for the help. I have managed to get my .properties file found. But I'm still having problems with the images. In my .war, I have (amongst others) the following directories: JSP Images Includes Now, my JSPs import html from Includes - this happens no problem. The html in Includes imports images from Images. However, they are never found.... I've tried everything I can think of - putting them in http/htdocs didn't work either. If I open the html from the desktop, the gifs are all present and correct, it's just the JSPs can't find them when accessed via Websphere. Cheers, Chris
In the configuration of your WAR file, make sure that in the AAT you set the flag that leaves file serving turned "on". You should then be able to have the browser obtain the GIF files from the WAR file through WebSphere. Kyle
One more thing -- what URL is your HTML looking for the GIF files at? That is, could you post a sample "image" tag here in Javaranch to show us what directory the browser is requesting? Kyle
Joined: Apr 23, 2002
If you are trying to access your .gif files as <pre> http://my.server.com/Images/myImage.gif </pre> as opposed to <pre> http://my.server.com/myWebApp/Images/myImage.gif </pre> This is a problem in WebSphere 4.0.3 and older. Another thing to look out for -- If you are in Windows, remember that everything serverd from a .war file is case sensitive. So if you called it /Images/myImage.gif in the .war file, it won't be able to find /images/MyImage.gif from an HTTP request.
Joined: Nov 25, 2002
Thanks for all the help guys. I eventually figured it out. The .html files were referring to the .gifs as "../images/pic.gif". This was fine when accessing the html straight from the desktop, but wouldn't work in the application. However, I changed them all to "images/pic.gif" and moved the images folder and now it's all fine. Now, I don't know if this is the best solution or whatever, but it worked so I'm happy.... I'm getting there!