Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File i/o from Tomcat

 
Gary Pierce
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Gary Pierce
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic