Export issue and file descriptors leak running XWiki 9.11.1 using freshly installed Jetty

I’ve spent hours diggin into this issue so it’s time to ask for some help.
I’ve been up this because it causes a file descriptor leak issue

I restarted everything from scratch to reproduce the issue I have on the production server.

I have installed Jetty runtime 9.4.8.v20171121 in a way which is a little different than what’s said in XWiki’s documentation in the fact that I want to separate JETTY_HOME and JETTY_BASE for maintenance ease, that way it’s very easy to upgrade Jetty runtime). For this I just followed the guide at Jetty’s doc

  • Initialized a Jetty BASE using start.jar and --add-to-start console-capture,http,deploy
  • unzip XWiki war 9.11.1 to webapps/xwiki
  • Copied over a mysql connector
  • created a database (create database xwiki default character set utf8 collate utf8_bin)
  • reflected credentials to the database in hibernate.cfg.xml and xwiki.cfg
  • create /etc/default/jetty and set JETTY_BASE, JETTY_HOME
  • Finally start jetty with shipped startup script (which reads /etc/default/jetty)
  • go to host:8100 and through the DW wizard to the end.

Visit the Sandbox space, select export in the menu, and look at “export as HTML” button.
Notice the Url of the button at this point is /xwiki/bin/export/Sandbox/WebHome?format=html
Finally click the button and you’ll get a download dialog : it works.

Now the main issue:
Paste http://host:8100/xwiki/bin/export/Sandbox/WebHome?format=html directly above in the browser. You’ll get an error 500 and the corresponding Exception

Others weird behaviors around that:

Get back to the Export menu and look again at the link associated with the button “Export as HTML”. It’s now:
/xwiki/bin/export/Sandbox/WebHome?format=html&pages=xwiki%3ASandbox.WebHome&pages=xwiki%3ASandbox.%25

(Notice button’s link has changed !)
Hit the button or Copy/paste this new link in broswer will both works this time.

If you go back again to the Export menu and unfold the Sandbox folder, you’ll see the URL is changing again to

xwiki/bin/export/Sandbox/WebHome?format=html&pages=xwiki%3ASandbox.WebHome&pages=xwiki%3ASandbox.TestPage1&pages=xwiki%3ASandbox.TestPage2&pages=xwiki%3ASandbox.TestPage3

…Which works too.

Here the URL that are not working in this setup:
Not working:

/xwiki/bin/export/Sandbox/WebHome?format=html
/xwiki/bin/export/Sandbox/WebHome?format=html&pages=xwiki%3ASandbox.WebHome
/xwiki/bin/export/Sandbox/WebHome?format=html&pages=xwiki%3ASandbox.WebHome&pages=xwiki%3ASandbox.TestPage1
xwiki/bin/export/Sandbox/WebHome?format=html&pages=xwiki%3ASandbox.WebHome&pages=xwiki%3ASandbox.TestPage1&pages=xwiki%3ASandbox.TestPage2

Various testings and observations leads:

  • I can’t reproduce the issue with Xwiki’s ZIP package / preinstalled with Jetty/HSQLDB. All of the URI above are working
  • Also tried to connect XWiki ZIP package to mariadb instead of HSQLDB and it works.
  • Same observation under Tomcat : all of the above’s working.

So the cause seems to be within Jetty’s setup when installed a described - by hand.
My questions are then :

  • why ? What’s included in ZIP’s embedded Jetty that can cause a difference ?
  • Even if there is a difference, shouldn’t we expect this exception to be handled ?