Results 1 to 2 of 2
  1. #1
    VishnuCBE is offline Member
    Join Date
    Mar 2010
    Posts
    1
    Rep Power
    0

    Default 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)

    Plz assist.

  2. #2
    j2me64's Avatar
    j2me64 is offline Senior Member
    Join Date
    Sep 2009
    Location
    Zurich, Switzerland
    Posts
    962
    Rep Power
    6

    Default

    Quote Originally Posted by VishnuCBE View Post
    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.

    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?

Similar Threads

  1. Working with Files in Java
    By Aditya Sriram in forum New To Java
    Replies: 2
    Last Post: 12-30-2009, 09:05 AM
  2. working with .ini files
    By pele in forum Advanced Java
    Replies: 0
    Last Post: 03-27-2009, 10:34 AM
  3. working with files (text files)
    By itaipee in forum New To Java
    Replies: 1
    Last Post: 02-24-2009, 12:38 PM
  4. Can someone help me working with files?
    By Goodwine in forum New To Java
    Replies: 4
    Last Post: 11-18-2008, 05:04 AM
  5. Replies: 8
    Last Post: 05-28-2008, 08:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •