Getting a misleading FileNotFoundException on my servlet class.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Wednesday, August 21, 2002 08:51 AM

I am running Tomcat 4.0.4 and I have on occassion ran into a FileNotFoundException that is misleading (where the root cause is not that the file is not found, but where a supporting class/.jar file is not present). For example, I get the following exception: java.io.FileNotFoundException: http://localhost:8080/BLAH/servlet/com.yada.UI.servlet.LogInServlet at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:549) The problem with this error is that the servlet does in fact reside at that location. As a proof of this point, I open up a browser and paste in the above URL. What happens is that the browser will just spin for a while because the get/post methods in this servl   More>>

I am running Tomcat 4.0.4 and I have on occassion ran into a FileNotFoundException that is misleading (where the root cause is not that the file is not found, but where a supporting class/.jar file is not present).


For example, I get the following exception:


java.io.FileNotFoundException: http://localhost:8080/BLAH/servlet/com.yada.UI.servlet.LogInServlet at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:549)


The problem with this error is that the servlet does in fact reside at that location. As a proof of this point, I open up a browser and paste in the above URL. What happens is that the browser will just spin for a while because the get/post methods in this servlet are actually expecting a serialized object. At any rate, what will happen if the file is truely not there is a 404.


When I have run into this error in the past, I have double checked that my supporting classes/.jars are present and in the right directories. I usually find that I forgot a .jar or one is out of date. When I remedy that I can run without issue. That is except for this time. I have checked thoroughly that all my dependencies are accounted for and am still getting that pesky FileNotFoundException.


Any help would be appreciated!


Steve

   <<Less

Re: Getting a misleading FileNotFoundException on my servlet class.

Posted By:   Anonymous  
Posted On:   Monday, August 26, 2002 07:33 AM

If you are using Linux or some kind of Unix,

a typical reason for these kinds of problems are file access permissions.



E.g. a Tomcat is running as a user that doesn't have the permissions to access the file, because some other user owns it.


It's almost allways the reason for problems like the one you explain.
About | Sitemap | Contact