Shawn,
On 2/6/24 13:52, Beard, Shawn wrote:
An application we have running in Tomcat 9 using Java 8 is throwing this
error when trying to create a file:
java.nio.file.FileSystemException
/path/to/filesystem/202311WEB/040389461310_08_37_246.jpg: Operation not
permitted at
sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixCopyFile.copyFile(UnixCopyFile.java:283) at
sun.nio.fs.UnixCopyFile.copy(UnixCopyFile.java:581) at
sun.nio.fs.UnixFileSystemProvider.copy(UnixFileSystemProvider.java:253)
at java.nio.file.Files.copy(Files.java:1274) at
org.apache.commons.io.FileUtils.copyFile(FileUtils.java:850) at
org.apache.commons.io.FileUtils.copyFile(FileUtils.java:756) at
com.genexus.specific.java.FileUtils.copyFile(FileUtils.java:45) at
com.genexus.util.GXFileInfo.copy(GXFileInfo.java:88) at
com.genexus.util.GXFile.copy(GXFile.java:298) at
com.binet17.webservices.awsingresodenunciabs_img_impl.privateExecute(awsingresodenunciabs_img_impl.java:477
We have tried opening up permissions on the files and directories,
adding users to the owner group, entries in the catalina.policy and
nothing seems to work. Any ideas?
This could be due to a lot of things, and it's unlikely to be related to
Tomcat itself.
Based upon your file path and stack trace, I suspect you are using a
UNIX-like operating system. That means it's not likely to be a locking
issue like you can have on Windows. Those are a real pain to catch in
the act. I would check a few things:
1. What is the euid and egid of the Tomcat process? Does it jive with
the file permissions for /path/to/filesystem/2023....blah.jpg? Remember
that in order for a process to be able to write to a directory, it needs
to have execute permissions from / all the way down to the last
directory in the path.
2. Double-check the UMASK that the process is using. If you are creating
directories, you'll need to make sure those directories have permissions
which are appropriate for writing files in there afterward.
3. Remember that the problem could be either the source file or the
destination file. From your path, I can't tell if the "operation not
permitted" is on the source or destination.
-chris
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org