Results 1 to 2 of 2
Thread: Working with Files in Java
- 03-24-2010, 09:03 AM #1Member
- Join Date
- Mar 2010
- Rep Power
Working with Files in Java
From my local machine I am running a Java code which fetches values from DB and writes it into a TXT file and save the TXT file into a different server say 'A'. This part is working fine if I run the Java code from my local machine.
I tried deploying the same Java code into a differnet server say 'B' and executed it, but it failed. The code is trying to save the TXT file into a unknown path which is not specified in the code rather than saving in the server 'A'.
Please note, Server 'B' is having write access on server 'A' and I have given the absolute path of server 'A' in code.
Can someone tell me why it is trying to save the TXT file to a path which is not specified in code?
I am getting the following error message :
java.io.FileNotFoundException: \\...\...\...(unknown path)
(Access is denied)
- 03-24-2010, 01:59 PM #2
maybe your local machine and the server A are both windows maschines, so from your local machine you can refer to the server with drive/path. but, if you transfer this code 1) to your server B this may have a different drive for server A or 2) if server B is a unix server and the code try to do the same like in windows it wont work.
can you specify what os are running on server A and server B and how you refer the server A path from the local maschine in java and how this path is seen from server B?
- By Aditya Sriram in forum New To JavaReplies: 2Last Post: 12-30-2009, 09:05 AM
- By pele in forum Advanced JavaReplies: 0Last Post: 03-27-2009, 10:34 AM
- By itaipee in forum New To JavaReplies: 1Last Post: 02-24-2009, 12:38 PM
- By Goodwine in forum New To JavaReplies: 4Last Post: 11-18-2008, 05:04 AM
- By sundarjothi in forum Advanced JavaReplies: 8Last Post: 05-28-2008, 07:00 AM