Tomcat seems to throw 404 errors every second request when accessing dynamically generated files
Posted on 2010-11-25
We have set up an environment in which exists 2 web servers.
Server 1 - Tomcat Server serving a Java host application.
Server 2 - IIS web server serving a proprietary application via web services
The issue we're having is as follows:
When a specific call is made to a particular web method on Server 2 it generates an html file and associated images on a shared drive. This in itself works fine.
This shared drive is permanently mapped as a virtual directory in Tomcat on Server 1, so that images related to the html page can be retrieved via Server 1 rather than requiring direct access to Server 2.
When the first request is made to retrieve the images, the html and images show fine.
However on subsequent requests Tomcat throws a 404. It then takes a few seconds to untangle itself, then 1 further request will work, followed by a string of 404s.
The individual http requests are completely independent requests for different urls (as the files being requested are dynamically generated with different names each time), and logging shows these files do exist on the drive before Tomcat requests the file to read and stream back.
We believe the problem lies with Tomcat although it's possible something else is going on.
Caching is disabled on the virtual directory.
Any help would be very much appreciated.