ShellExecute error when viewing fax on Windows

When trying to open or preview a fax on Windows you may get an error message similar to the following one:

java.io.IOException: Failed to open file:/C:/Temp/user/fax1607260423703060917.tiff. Error message: Access is denied.

        at sun.awt.windows.WDesktopPeer.ShellExecute(Unknown Source)
        at sun.awt.windows.WDesktopPeer.open(Unknown Source)
        at java.awt.Desktop.open(Unknown Source)
        at yajhfc.Java6DesktopManager.open(Java6DesktopManager.java:65)
        [...]

For this article to apply the first line of the stack trace must always contains a line referring to sun.awt.windows.WDesktopPeer.ShellExecute.
The text after Error message may be different, however (for example "A device attached to the system is not functioning.")

Reason

Most likely the reason for this behaviour is that there is no program associated (in Windows) to open the file type with.

In the example above (on Windows XP), there was no program associated with TIFF files in Windows Explorer which led to this error in YajHFC. On other Windows versions you may get different error messages.

The error message given is usually completely misleading. Since this is actually a Java and/or Windows behaviour this is hard to detect and fix programatically.

Solutions

You have the following options to solve this problem:

  1. The straightforward fix is associating a program with the file type in question (e.g. by double clicking a TIFF/PDF/PS file in Windows Explorer and selecting a viewer in the dialog).
  2. You can also work around this problem by explicitely setting a viewer application in YajHFC using OptionsPaths & Viewers