Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Unable to Read remote file using Servlets

Posted on 2005-03-08
9
Medium Priority
?
263 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
  • 3
  • 2
  • 2
  • +1
8 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
A solution for Fortify Path Manipulation.
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Suggested Courses
Course of the Month14 days, 3 hours left to enroll

580 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