Thanks for all people who replied to my question. I took Emmanuel Bourg's 
advice that did the trick. It works!

    On Monday, July 1, 2019, 02:53:11 PM PDT, Emmanuel Bourg 
<ebo...@apache.org> wrote:  
 
 Le 01/07/2019 à 19:55, W a écrit :
> Hi,I am migrate from ubuntu 16.04 (server), mysql 5.7 and tomcat 8 to ubuntu 
> 18.04(server), mysql 8 and tomcat 9.
> My application works on old system. Now when my application tries to write a 
> file on
> a directory (permission allowed), there is an 
> error:java.nio.file.FileSystemException: /photoLogos/PERSON/-_~x: Read-only 
> file system

The tomcat9 package on Debian/Ubuntu uses systemd and leverages its
sandboxing feature to limit the write access to the conf, log, work and
webapps directories by default. If you look at the package's README file
(/usr/share/doc/tomcat9/README.Debian) you'll find the instructions to
grant Tomcat write access to other directories:

https://salsa.debian.org/java-team/tomcat9/blob/master/debian/README.Debian

  If write access to other directories is required the service settings
  have to be overridden. This is done by creating an override.conf file
  in /etc/systemd/system/tomcat9.service.d/ containing:

    [Service]
    ReadWritePaths=/path/to/the/directory/

  The service has to be restarted afterward with:

    systemctl daemon-reload
    systemctl restart tomcat9

Emmanuel Bourg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

  

Reply via email to