Today a strange thing happened while I was working on our company project. We use Sun webserver to deploy our java application.
We were testing our application as its that scary testing phase. (I say scary because, we have a points system where our points are directly related to the number of bugs found while testing.)
And on such a day, our application which till afternoon was working fine, suddenly stopped working. It could not connect to the database!
I checked everything, the code, the connection pool classes, the web server configuration, the data source settings and configuration and even the database.
I and my team broke our heads to resolve the issue. But all was going in vain.
Then after an hour and half, I finally decided to blame it on the database and told the same to the DBA. For which he ofcourse disagreed.
Then the matter was escalated and our development head for help. By looking the at logs he that the .dtd is missing.
Well, there were only 2 xml files, one is web.xml and other is sun-web.xml (sun-web.xml is specific to Sun wevserver). Both were pointing to a internet site of Sun (Example : http://www.sun.com/software/dtd/appserver/sun-web-app_2_5-0.dtd).
I decided to check them on the browser and to my surprise, I found that the Sun's server which hosts these .dtd files has gone down.
Phew, finally found the issue , We then downloaded the .dtd file from some other place and placed it in the config folder of the sun webserver.
All was fine then, the application started working fine.
But due to this lack of knowledge, we wasted about 2 hours, which can be crucial.
So the moral of the story is that any server can go down, so always make sure you place the .dtd or .xsd file which you are referring in your xml on your local server.