3

Getting symlink error after migrating to tomcat server 8.5.65 On tomcat startup (running spring mvc project) getting symlink error as below:

SEVERE : org.apache.catalina.webresources.AbstractFileResourceSet.file Resource for web application [/] at path [/] was not loaded as the canonical path [/] did not match. Use of symlinks is one possible cause.

Mark Rotteveel
  • 90,369
  • 161
  • 124
  • 175
Monish
  • 31
  • 1
  • I'm seeing this in 8.5.64 as well – Andrew Schlei Apr 20 '21 at 18:22
  • Is the text in your brackets ("[/]") the actual text in the error or did you change it for posting? I ask because in my warning the text for the path is different from the text for the canonical path (the canonical path has question marks for UTF-8 characters). – theyuv Jun 01 '22 at 06:56

1 Answers1

1

We found that in our case, this error was appearing because the default character set in our OS was not set to UTF-8. To resolve, we added the following lines to the TOMCAT_HOME/bin/setenv.sh script:

export LC_ALL="en_US.utf8"
export LANG="$LC_ALL"
Templar
  • 4,947
  • 7
  • 32
  • 39
  • Can you explain this a bit. Why does changing the OS character set fix this issue? All of the other answers (eg: https://stackoverflow.com/a/138950/3684479 or https://balusc.omnifaces.org/2009/05/unicode-how-to-get-characters-right.html) which explain how to make sure your setup can handle utf-8 characters do not include this... However, it does fix the issue. – theyuv Jun 01 '22 at 08:22