#24849 closed defect (invalid)
NoSuchFileException if photo deleted from disk while opening
| Reported by: | aharvey | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Core | Version: | |
| Keywords: | Cc: |
Description
An unexpected exception occurs if you delete a file from the disk between first opening it and when JOSM opens the image.
- Drag a bunch of JPG images into JOSM
- While they are still loading, delete one of the images from the disk
- JOSM then throws an unexpected exception
It's expected in such a situation to silently ignore that removed file, or if you prefer to show a warning, not crash the whole application.
`
STACK TRACE
Thread: AWT-EventQueue-0 (33) of main
java.nio.file.NoSuchFileException: /tmp/photo.JPG
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:261)
at java.base/java.nio.file.Files.newByteChannel(Files.java:380)
at java.base/java.nio.file.Files.newByteChannel(Files.java:432)
at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:420)
at java.base/java.nio.file.Files.newInputStream(Files.java:160)
at org.openstreetmap.josm.data.gpx.GpxImageEntry.getInputStream(GpxImageEntry.java:887)
at org.openstreetmap.josm.gui.layer.geoimage.ImageMetadata.extractExif(ImageMetadata.java:377)
at org.openstreetmap.josm.data.gpx.GpxImageEntry.extractExif(GpxImageEntry.java:882)
at org.openstreetmap.josm.gui.layer.geoimage.ImagesLoader.realRun(ImagesLoader.java:96)
at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:94)
at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:142)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
`
Attachments (0)
Change History (2)
comment:1 by , 4 weeks ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
comment:2 by , 3 weeks ago
Maybe we mean different things by "crash", indeed JOSM shows the popup you described, but that is unexpected at should be handled as something other than an unhanded exception.



I cannot reproduce a crash, JOSM shows the same stacktrace in the standard popup and allows to either report this as a bug or ignore the error. So, if you really faced a complete crash I guess that this was caused by JAVA, else you can close the popup with the ignore button.