Tomcat + MySQL docker container outputting utf8 text with wrong encoding -


experiencing incorrect encoding on utf8 text output tomcat:8.0 container retrieved mysql:5.6 container.

connecting mysql container directly , querying on shell proves text stored in database correctly.

also utf8 content within templates output tomcat container fine.

the jdbc connector string reads: nfc.jdbc.mysql.url=jdbc:mysql://mysql:3306/mydatabase?autoreconnect=yes&useunicode=yes&characterencoding=utf-8

here's tomcat dockerfile i'm using:

from tomcat:8.0 run apt-get update && \     apt-get -y install libmysql-java run echo 'classpath=/usr/share/java/mysql.jar' >> /usr/local/tomcat/bin/setenv.sh  

and mysql dockerfile:

from mysql:5.6  run { \     echo '[mysqld]'; \     echo 'character-set-server = utf8'; \     echo 'collation-server = utf8_unicode_ci'; \     echo '[client]'; \     echo 'default-character-set=utf8'; \     echo '[mysql]'; \     echo 'default-character-set=utf8'; \ } > /etc/mysql/conf.d/charset.cnf volume /var/lib/mysql 

the tomcat run command is:

docker run \   --rm \   --name tomcat-server \   --volume $(pwd)/../../webapp:/usr/local/tomcat/webapps/mywebapp \   --volume $(pwd)/../../tomcat-users.xml:/usr/local/tomcat/conf/tomcat-users.xml:ro \   --link mysql-server:mysql \   --publish 8088:8080 \   --tty \   --interactive \   tomcat-server 

i'm using same mysql image provide content other docker container web servers (python/django) being pulled , output correct encoding.

i have no real understanding of contents of tomcat webapp , don't know java.

the developer has demonstrated application running windows server producing correctly encoded data, have no understanding of docker, , we're spinning our wheels not getting anywhere!


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -