| Author |
File i/o from Tomcat
|
Gary Pierce
Greenhorn
Joined: Apr 03, 2006
Posts: 3
|
|
A servlet, with the help of POJOs, tries to see if a file exists at different locations in the network. It goes thru' a set of locations one by one. When executed, for some locations, it reports that the file does not exist, even though it does actually. Here is the simplified version of the code. The same code when executed outside the container i.e.,from a main() call, it works fine. Any suggestions? Thanks GP
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
How are you running Tomcat? If you are running it as a Windows service, check to see if the user under which the service runs has network permissions. From the services window, you can change which user the service runs under. This solved the same problem for me. -Ben
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
Gary Pierce
Greenhorn
Joined: Apr 03, 2006
Posts: 3
|
|
Thanks Ben. Yes, Tomcat runs as a Windows service, with my network user id account. With the same id, like I said, this works fine when run outside the container as a plain Java program with main() method. Thanks GP
|
 |
 |
|
|
subject: File i/o from Tomcat
|
|
|