Getting a FileNotFoundException
while reading a Japanese folder structer from a Tomcat 7 web application. But it's working in a Docker container and direct java console execution.
Both Docker and normal tomcat7 setup and configurations are the same.
We have done following configurations:
server.xml
- In Connector tag added 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