Questions tagged [filenotfoundexception]

A Java or Android exception that indicates that the file denoted by a specified pathname could not be opened.

This exception is part of the old Java file API. Newer code in Java (note: NOT Android) should use JSR 203 instead (i.e. Paths, Files). JSR 203 (known as NIO.2) has its own java.nio.file.NoSuchFileException, see also .

One problem with this exception is that despite its name, it doesn't always mean that the filesystem object at the given path is actually missing. Here are a few possibilities where this exception can be thrown with a cause other than the file missing:

  • permission denied: an attempt is made to open the file in write mode but the process only has read only access; or the file is in a directory the contents of which the application cannot access;
  • read only filesystem: an attempt is made to open the file in write mode, the process has write access to the file but the underlying filesystem is read only;
  • symbolic link loop: the denoted path is a symbolic link which loops on itself.
1712 questions
8
votes
3 answers

Access is denied when using FileOutputStream

I'm having an issue getting this to work. It takes in a string which consists of several pieces of information put together. However, when I try to write the String to a file in order to track changes in the program over time, I receive an access…
Nick
  • 191
  • 1
  • 2
  • 9
8
votes
2 answers

Xamarin build error Exception while loading assemblies: System.IO.FileNotFoundException

always i try to Build my Xamarin app i get this error. And i dont know why. I use the System.Security.dll of .Net Framework 4 and i though this should work. Thanks. C:\Program Files …
Boot750
  • 891
  • 1
  • 7
  • 17
8
votes
2 answers

AppDomain.Load() fails with FileNotFoundException

I'm trying to load my plugin dll into separate AppDomain, but Load() method fails with FileNotFoundException. Moreover, it seems like setting PrivateBinPath property of AppDomainSetup has no effect, because in log I see "Initial PrivatePath = NULL".…
dedpichto
  • 220
  • 1
  • 4
  • 9
8
votes
7 answers

Could not load file or assembly CrystalDecisions.CrystalReports.Engine

My user's Terminal Runs 2 application. One of which I built an application using VS 2005 with Crystal Reports bundled version and another outside product which uses a different Crystal Report version. There were about 25 users who use the same…
hiFI
  • 1,887
  • 3
  • 28
  • 57
8
votes
5 answers

java.io.FileNotFoundException on an existing file

I am getting this error when I try to open a file: java.io.FileNotFoundException: D:\Portable%20Programs\Android%20Development\workspace3\XXX-desktop\bin\World_X.fr (The system cannot find the path specified) at…
Rafay
  • 6,108
  • 11
  • 51
  • 71
7
votes
2 answers

GetExportedTypes() FileNotFoundException: Assembly couldn't be found

My task: Find all Forms (WindowsForm or WPF, doesn't matter) in a dll or exe file and return that list. In theory that works (meaning: if I've an assembly with a WPF or WindowsForm my code manages to get all Forms, TextBoxes, Labels etc. ). When it…
Steffen Winkler
  • 2,805
  • 2
  • 35
  • 58
7
votes
2 answers

JAVA + try catch(FileNotFoundException e) going in catch(Exception e)?

I have some command which creates a file on disk. Because the folder in which the file has to be created is dynamic, I have a catch(FileNotFoundException e). In the same try block, I already have a catch(Exception e) block. For some reason, when I…
user706058
  • 415
  • 3
  • 11
  • 23
7
votes
1 answer

how to set authorization header with android's httpURLconnection

I am attempting to connect to my server using basic authentication, but when I set the Authorization header, it causes getInputStream to throw a fileNotFound exception. Here is the relevant code: URL url = new URL(myurl); //set up…
7
votes
6 answers

keytool error: java.io.FileNotFoundException: C:\cacerts (Access is denied)

I am on Windows 10 with JRE8 and the command I'm using is: C:\Program Files\Java\jre1.8.0_60\bin>keytool -keystore "C:\cacerts" -storepass changeit -importcert -file "C:\Users\MyUser\Desktop\sf.cer" -alias Symantec_Secure_Server_Class_3 Here's what…
7
votes
2 answers

File not found error after selecting a file in android

I want to open a .pdf file in my android app.now i can browse the pdf file and after browsing the file I am getting File Not Found Error when i check the file exist or not. Now after selecting the file my selected file Uri data.getData() is like…
SHIDHIN TS
  • 1,557
  • 3
  • 26
  • 58
7
votes
6 answers

FileNotFoundException (File too large)

I am getting this exception when trying to download a file Caused by: java.io.FileNotFoundException: /repository/PWWVFSYWDW0STLHYVEEKHMYBXZTTETGROCQ4FGdsadadaXR1407709207964905350810526.jpg (File too large) at java.io.FileOutputStream.open(Native…
Poyraz
  • 359
  • 1
  • 5
  • 12
7
votes
2 answers

LibGDX can't load a specific image

I've loaded all of my images successfully in the past and I'm using OpenGL ES 2.0 so the images don't need to be powers of two (I have several loaded successfully that aren't). The code in question is this: Line 96: splashSheet = new…
Panini Raman
  • 491
  • 1
  • 5
  • 12
7
votes
2 answers

Java can't see file on file system that contains illegal characters

I am experimenting with an edge case we're seeing in production. We have a business model where clients generate text files and then FTP them to our servers. We ingest those files and process them on our Java backend (running on CentOS machines). …
IAmYourFaja
  • 55,468
  • 181
  • 466
  • 756
6
votes
4 answers

Get FileNotFoundException when initialising FileInputStream with File object

I am trying to initialise a FileInputStream object using a File object. I am getting a FileNotFound error on the line fis = new FileInputStream(file); This is strange since I have opened this file through the same method to do regex many times. My…
Ankur
  • 50,282
  • 110
  • 242
  • 312
6
votes
4 answers

Java reading txt.file - access denied?

I have created a txt file which I have saved in My Documents on my computer. I am trying to read the txt file through FileReader and BufferedReader. However, when I try to run the program I get the error message: java.io.FileNotFoundException:…
Kristian
  • 1,239
  • 12
  • 31
  • 44