This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • 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