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
0
votes
2 answers

How do I get the location of a folder?

I am currently writing a game, titled Legend of Zork (development title), mostly to keep me busy writing code and learning Java on a deeper level. I am stuck on a particular task, however. I wish to be able to copy the containing folder to anywhere…
user2801000
0
votes
1 answer

Can't find specified path when using .. in the middle?

I'm trying to write in a file with a path like this: D:\abcd\efgh\..\ijkl\file.txt So I have an File object with such a path, but in the line FileOutputStream fos = new FileOutputStream(f); I get this: java.io.FileNotFoundException:…
S.Pro
  • 633
  • 2
  • 12
  • 23
0
votes
1 answer

File not found exception for my MyWebservice.XmlSerializers when using PrincipalSearcher.FindAll()

I have a web service added by service reference (called "MyServiceReferences") in my ASP .NET MVC 4 solution. Also I have an Active Directory service in another project in the same solution. I am trying to display user name (First name and Last…
0
votes
3 answers

I am having a null pointer exception and i'm not sure where it is in my code

I am having issues with various exceptions in my code. The class is designed to find all folders/subfolders on the computer and list them as an ArrayList. It does not care about the files in them. Here is the code. please help, I have been…
0
votes
2 answers

c# application stops working on pc without vs 2012

So I have a c# application that runs perfect on my machine. When I try to run it on a pc without vs 2012 I get this exception at some point. I cant figure out what vs is installing that my application is referring…
Florian Schaal
  • 2,586
  • 3
  • 39
  • 59
0
votes
1 answer

Pause the execution of Java if files are used

My application writes to Excel files. Sometimes the file can be used, in that case the FileNotFoundException thrown and then I do not know how to handle it better. I am telling the user that the file is used and after that message I do not want to…
Olga
  • 309
  • 4
  • 16
0
votes
0 answers

FileNotFound even though File does exist

Excuse me for the sloppy code, it is just a test project and I've been working on this bug for at least a week now public static void main(String[] args){ // TODO Auto-generated method stub List report = new ArrayList(); …
0
votes
2 answers

scala - bash: hw.scala: Permission denied

I installed scala with sbt according this post Getting started. But when I created easy start project Hello world I met weird output: nazar_art@nazar-desctop:~$ find…
catch23
  • 17,519
  • 42
  • 144
  • 217
0
votes
1 answer

csv FileNotFoundException: ENOENT

I am trying to access a csv file from the assets for my app and all I get is FileNotFoundException. I get the same when I try to access it from elsewhere. Any idea what I should be doing here? Log messages work just fine until then. The error on…
0
votes
1 answer

Loading ResourceManager from separate assembly produces FileNotFound?

I have an assembly I'm trying to load with reflection and read a Resource string from. So, I use something like this: config.Extras="C:\dev\foo.dll"; string dir = Directory.GetCurrentDirectory(); string tmp =…
Earlz
  • 62,085
  • 98
  • 303
  • 499
0
votes
1 answer

Loading properties file gives null

In the main() class i put a code: App.getClass().getClassLoader().getResourceAsStream("Repo-Offer.properties") the result is null The property file resides in: Project/src/main/resources/properties/Repo-Offer.properties I was trying to load…
mCs
  • 167
  • 1
  • 4
  • 16
0
votes
1 answer

What causes this System.IO.FileNotFoundException in ReportViewer?

I have a desktop application which requires a report viewer application to print a file. I am getting an exception at runtime even after installing the application version 2005, 2008, and 2010. Error : System.IO.FileNotFoundException: Could not…
user1010399
  • 2,258
  • 5
  • 30
  • 42
0
votes
1 answer

Trouble Finding CSV File (with and without OpenCSV) in Eclipse for Android

I'm having trouble reading from a csv file for my Android project. I'm using a Mac, with Eclipse ADT, and have imported OpenCSV. The problem that I keep running into is that the file is not found. I have tried putting it everywhere, including: in…
user2323030
  • 1,193
  • 4
  • 16
  • 37
0
votes
1 answer

FileNotFoundException: ENOENT...but, but, but I have a file

I'm using the following try/catch to try to parse a pipe-separated text file into an array ( each line is like this: spanishword|englishword|spanishword.mp3 ) for a flashcard app. Pretty simple, but I'm a complete noob. Here is what I cobbled…
Peltier Cooler
  • 157
  • 1
  • 12
0
votes
0 answers

FileNotFoundException when referencing (managed) C++ Assembly from a C# Console App

I am in the process of writing a .NET wrapper for legacy native c++ code. My strategy is to write a CLR class library that wraps the native code. To test whether the class library is functioning properly, I created two console apps in separate…