• Post Reply Bookmark Topic Watch Topic
  • New Topic

help writing to a textfile on a network share  RSS feed

 
Dave Bosky
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to write to a text file on network share and keep receiving the
following error msg:

------------------------------------------------
IOException: java.io.FileNotFoundException:
\\myserver\dev\projects\projbefore\trans.txt
(The system cannot find the file specified)
------------------------------------------------

I store the share path in my web.xml file:



Any ideas? It must be something simple.

Thanks
Dave
 
Pedro Gongora
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I know, the url(?) notation //x/y/z is propietary of windows, and only windows explorer understand it. If you open a file with java io libraries, it will fail.

Why you don't try creating a network drive pointing to that location and use that in your code (ie. X:/y/z).
 
Jon Pincott
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What user is your Tomcat running as? The default "LocalSystem" user doesn't have access to network resources, so you'll have to change to one that does.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!