?
Solved

Unable to Read remote file using Servlets

Posted on 2005-03-08
9
Medium Priority
?
261 Views
Last Modified: 2013-11-24
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
0
Comment
Question by:zailsingh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
9 Comments
 

Author Comment

by:zailsingh
ID: 13484649
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
 
LVL 5

Expert Comment

by:Triguna
ID: 13484690
use relative path like,   ../../text.doc

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

better use, forward slash "/".
0
 
LVL 6

Expert Comment

by:durgaprasad_j
ID: 13484748
hi,
        I think the problem is with special characters.
 
         try using f:\\something\\alkjdf\\temp.txt
0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
LVL 5

Expert Comment

by:Triguna
ID: 13484752
what I told above is same thing.
0
 

Author Comment

by:zailsingh
ID: 13484763
Guys - I have found the resolve myself it was related to serialization. After I serialised the servlet it worked..
0
 
LVL 6

Expert Comment

by:durgaprasad_j
ID: 13484837
sry triguna, i opened this window long ago before you typed your message. I saw your message after i sent my message.
0
 
LVL 5

Expert Comment

by:Triguna
ID: 13484867
durgaprasad_j,
   its ok.

zailsingh,

    Explain the solution, This will help others to know the solution.
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 13701742
PAQed with points refunded (125)

modulo
Community Support Moderator
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses
Course of the Month12 days, 5 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question