1

Hi I am getting the below error while trying to FTP the file to destination..

Code I used:

 final String destinationFile = destinationFolder + inputFile.getName();

 OutputStream output = null;
    try {

        output = new FileOutputStream(destinationFile);

    } catch (Exception e) {
        System.out.println("Error creating output file");
        e.printStackTrace();
    }

Exception:

java.io.FileNotFoundException: \bsgdata1\dba1\jubair\ftpPDF\TMPAAA6CaWnR.pdf (The system cannot find the path specified)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(Unknown Source)
    at java.io.FileOutputStream.<init>(Unknown Source)
    at com.finacle.pdf.reportgenerator.util.FtpUtil.ftp(FtpUtil.java:96)
    at com.finacle.pdf.reportgenerator.PdfReportGenerator.generate(PdfReportGenerator.java:86)
    at com.finacle.pdf.reportgenerator.PdfReportGenerator.main(PdfReportGenerator.java:35)
Exception in thread "main" java.lang.NullPointerException
    at com.finacle.pdf.reportgenerator.util.FtpUtil.ftp(FtpUtil.java:110)
    at com.finacle.pdf.reportgenerator.PdfReportGenerator.generate(PdfReportGenerator.java:86)
    at com.finacle.pdf.reportgenerator.PdfReportGenerator.main(PdfReportGenerator.java:35)
4
  • is destinationFolder.exists() true ? Commented Feb 28, 2013 at 9:01
  • 1
    Are you trying to write file via FTP? I think you need to use some java FTP library. Commented Feb 28, 2013 at 9:02
  • As the exception says: \bsgdata1\dba1\jubair\ftpPDF\TMPAAA6CaWnR.pdf is not a valid path. Commented Feb 28, 2013 at 9:04
  • javadoc says: If the file exists but is a directory rather than a regular file, does not exist but cannot be created, or cannot be opened for any other reason then a FileNotFoundException is thrown. Commented Feb 28, 2013 at 9:09

1 Answer 1

1

It seems like the File directory is not reachable/acceesable. Most likely it is because either the network/ftp is not available or the path is not correct. if you can place the entire code/project I can assist you in debuging the same

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.