File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes FileNotFoundException from Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "FileNotFoundException from Servlet" Watch "FileNotFoundException from Servlet" New topic
Author

FileNotFoundException from Servlet

Ajai
Ranch Hand

Joined: May 29, 2002
Posts: 198
Hi All,

I am trying to access a PDF file on shared windows folder from a servlet running on UNIX server.
The path seems to be correct x:\shared\x.pdf
but when servlet tries to access this file it throws FileNOtFoundException even though file is there..
Any suggestions.
Thanks
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

If the servlet is running on a Unix server, what does x:/ mean? ie how is the servlet going to find the PDF given this information?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
The jCIFS library (jcifs.samba.org) can access Windows shares, and has an interface exactly like java.io.File, so it's rather easy to use.


Ping & DNS - updated with new look and Ping home screen widget
Ajai
Ranch Hand

Joined: May 29, 2002
Posts: 198
Thanks for the replies.

David ,

Just trying to share my problem again.

I want to read a file on window share from servlet running on app server.
Is it possible ?

Thanks
Roman Tomachinsky
Greenhorn

Joined: Apr 24, 2006
Posts: 12
Did you try using Microsoft Windows UNC path name, like \\computer\shared\x.pdf?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
Did you actually read and consider the replies you got? David is spot on: the server can't possibly know what "x:\shared\x.pdf" is, because that path has meaning only locally on the Windows machine. That's why you need to use jCIFS.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: FileNotFoundException from Servlet
 
Similar Threads
Creating a parameter
The system can only find one of the two files specified
Servlet hosting problem
files
System cannot find the path specified