Failed to exec Operation not supported

Jenkins JIRA | jkrabbenbos | 7 years ago
  1. Speed up your debug routine!

    Automated exception search integrated into your IDE

  2. 0

    Java + WinSock

    Google Groups | 1 decade ago | Alexis Operation not supported
  3. 0

    When trying to lock a file that is on a SMB or an AFP network filesystem, FileChannel.tryLock() throws an IOException with the message "Operation not supported" . The reason seems to be that the JRE uses the call fcntl to try to lock files on these network shares. On OS X fcntl does not support locking files on AFP or SMB (I believe NFS works alright, but am not certain). A possible alternative is perhaps the call flock for AFP and SMB. More general information can be found on,_Mac_OS_X,_and_SMB.html To test the problem, mount an SMB or AFP share on a OS X machine. Then run this code with one of the mounted files as argument: import*; import java.nio.channels.FileChannel; import java.nio.channels.FileLock; public class FileLockTest { public static void main(String[] args) throws Exception { RandomAccessFile file = null; FileLock fileLock = null; try { file = new RandomAccessFile(args[0], "rw"); FileChannel fileChannel = file.getChannel(); fileLock = fileChannel.tryLock(); if (fileLock != null){ System.out.println("File is locked"); } } finally{ if (fileLock != null){ fileLock.release(); } } } } When working properly, you should see the text "File is locked". When failing, you see something like: Exception in thread "main" Operation not supported at Method) at at at java.nio.channels.FileChannel.tryLock( at FileLockTest.main( Please note that the thrown exception is not very helpful, because it is a plain IOException with some message. As a programmer, I'd like to distinguish between a real failure or an unsupported operation. Even if for some reason proper locking cannot be implemented, please implement a specific exception that is thrown in case a file cannot be locked, because the mechanism isn't properly implemented or supported by the OS. Something like FileLockUnsupportedException (subclass of IOException) with a proper reason that perhaps contains the filesystem type.

    JDK Bug System | 4 weeks ago | Hendrik Schreiber Operation not supported

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis


      Failed to exec Operation not supported

      at hudson.lifecycle.UnixLifecycle.restart()
    2. Hudson
      1. hudson.lifecycle.UnixLifecycle.restart(
      2. hudson.model.Hudson$
      2 frames