I get a FileNotFoundException
while reading a Japanese folder structure from a Tomcat 7 web application in CentOS 7. However, it's working in a Docker container and direct Java console execution.
Both Docker and normal tomcat7 setups and configurations are the same.
We have done the following configurations:
server.xml
- In the Connector tag add URIEncoding
attribute as:
<Connector port="8080"
protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
URIEncoding="UTF-8"/>
catalina.sh
- added following:
export JAVA_OPTS="$JAVA_OPTS -server \
-XX:-UseGCOverheadLimit \
-Djava.awt.headless=true \
-Djavax.servlet.request.encoding=UTF-8 \
-Dfile.encoding=UTF-8"
export CATALINA_OPTS="$CATALINA_OPTS \
-Dfile.encoding='UTF-8'"`
export LC_ALL=en_US.UTF-8
Upgrade Tomcat7 to tomcat9 or Tomcat7.0.109. The support is not available in Tomcat7 Early versions