aspose file tools*
The moose likes Servlets and the fly likes help writing to a textfile on a network share Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "help writing to a textfile on a network share" Watch "help writing to a textfile on a network share" New topic
Author

help writing to a textfile on a network share

Dave Bosky
Ranch Hand

Joined: Dec 16, 2003
Posts: 72
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

Joined: Oct 03, 2003
Posts: 17
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

Joined: Jul 28, 2004
Posts: 17
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.


SCJP SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: help writing to a textfile on a network share
 
Similar Threads
how to get jsp init params
browser stopping at .do page
wsdd urgent help
Why this code to get Init Param in JSP not work?
wsdd urgent help Web Services