Problem
I have a client that is running a webapplication polling a specific directory. Files with special characters, are having those characters converted to '?".
Example filename: java.io.FileNotFoundException: Garc??a.pdf (No such file or directory)
I do not get the specific filename from the database and the file has the correct filename on the disk. I have not been able to reproduce it on my own machine.
Tomcat Startup Params
[-Dnop]
[-Dcatalina.home=/app/tomcat]
[-Dcatalina.base=/app/tomcat]
[-Djava.io.tmpdir=/app/tomcat/tmp]
[-Djava.endorsed.dirs=/app/tomcat/lib-endsed]
[-Dep.tomcat.http.port=8080]
[-Dep.tomcat.shutdown.port=64006]
[-Dep.tomcat.rmi.port=64008]
[-Dep.tomcat.sso.enabled=false]
[-Djava.security.auth.login.config=/app/tomcat/etc/jaas.config]
**[-Dfile.encoding=UTF-8]**
[-Dcom.sun.management.jmxremote=true]
[-Dcom.sun.management.jmxremote.port=64007]
[-Dcom.sun.management.jmxremote.authenticate=true]
[-Dcom.sun.management.jmxremote.ssl=false]
[-Dspring.profiles.active=production]
[-Degrants.configuration=/app/tomcat/etc/test.properties]
[-Dops.product=tomcat]
[-Dops.node.number=uniq]
[-Xms1024m]
[-Xmx1024m]
[-XX:PermSize=128m]
[-XX:MaxPermSize=128m]
[-XX:+UseParallelGC]
[-XX:+AggressiveOpts]
[-XX:+UseFastAccessorMethods]
Folder
The specific folder is a shared space using NFS
Java Version
java version "1.6.0_91"
Java(TM) SE Runtime Environment (build 1.6.0_91-b13)
Java HotSpot(TM) Server VM (build 20.91-b07, mixed mode)
System Lang Parameter
env | grep LANG
NLS_LANG=American_America.UTF8
Checking the Charset/Encoding
I included the code from the answer @ How to Find the Default Charset/Encoding in Java? . The log prints that UTF-8 is being used:
Default Charset=UTF-8
file.encoding=UTF-8
Default Charset in Use=UTF8
Question
Except for asking the client to change the JDK I can't really think of something else to do. Any suggestions? What could be causing this? How do I resolve it?
Update-Polling Folders
Filenames are extracted from polling the actual file system. We are using the listFiles() method of the File java class to get back the files within folders. Ref: https://docs.oracle.com/javase/6/docs/api/java/io/File.html#listFiles()