Unable to Read remote file using Servlets

Hi - Im using a servlet that is trying to read a file lying on a remote machine. The absolute path of that file is mapped as("F:\text.doc") on the machine that is running this servlet. All access permissions network permissions on NT and using policytool are set.

All the time I get an exception java.io.FileNotFoundException <file path> (Access is Denied)

The same code runns perfectly fine when the location of file is C:\ i.e. local path and not a mapped path of a remote location machine on the same network.

rgds
zailsinghAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

zailsinghAuthor Commented:
In fact the mapping to "F:\" is done on the machine where the servlet is deployed and executed. I can access the file by going to Start-Run and copy paste the same path that the servlet is trying to read. And this works
0
TrigunaCommented:
use relative path like,   ../../text.doc

and you are using, \ then you have to escape the \

better use, forward slash "/".
0
durgaprasad_jCommented:
hi,
        I think the problem is with special characters.
 
         try using f:\\something\\alkjdf\\temp.txt
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

TrigunaCommented:
what I told above is same thing.
0
zailsinghAuthor Commented:
Guys - I have found the resolve myself it was related to serialization. After I serialised the servlet it worked..
0
durgaprasad_jCommented:
sry triguna, i opened this window long ago before you typed your message. I saw your message after i sent my message.
0
TrigunaCommented:
durgaprasad_j,
   its ok.

zailsingh,

    Explain the solution, This will help others to know the solution.
0
moduloCommented:
PAQed with points refunded (125)

modulo
Community Support Moderator
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.