0

After upgrading to eXist-db 4.7.0, we have now Jetty 404 errors for filenames with UFT-8 accented or Chinese characters. Any idea if there is a config file to manage that?

For eg.:

HTTP ERROR 404
Problem accessing /.../dicoEnviro-fr/humanit%C3%A9.xml.
Reason: Document /.../dicoEnviro-fr/humanité.xml not found
Powered by Jetty:// 9.4.14.v20181114
Jee Mok
  • 6,157
  • 8
  • 47
  • 80
Benoit
  • 1

1 Answers1

0

Use Jetty 9.4.20.v20190813 (there are updates to UTF-8 handling of resources on java.nio.file.FileSystem present since 9.4.16.v20190411 that you need)

Since I don't know what eXist-db does to start Jetty, I'm going to assume it's embedded, and answer based on that assumption.

Make sure your ServletContextHandler or WebAppContext is declared to use a Base Resource that is defined as a PathResource object pointing to your directory location defined as a java.nio.file.Path object.

Advice about Base Resource declaration:

  • Do not use a String to define it, that winds up being a URLResource which works with URL references, not file system paths, and you'll have the problem you are experiencing.
  • Do not use a File to define it, as that winds up being a FileResource which is deprecated functionality, and known to have problems with UTF-8 references.
  • Ensure your java.nio.file.Path is an absolute path. (no relative paths)
  • Ensure your java.nio.file.Path is normalized. (no "//" or "/../" segments)
Joakim Erdfelt
  • 46,896
  • 7
  • 86
  • 136