jetty / jetty.project

Eclipse Jetty® - Web Container & Clients - supports HTTP/2, HTTP/1.1, HTTP/1.0, websocket, servlets, and more
https://eclipse.dev/jetty
Other
3.85k stars 1.91k forks source link

"No multipart config for servlet" when upgrading from Jetty 9.4.x to Jetty 10.0.0 #5987

Closed vmassol closed 3 years ago

vmassol commented 3 years ago

Hi guys,

On XWiki our CI runs our functional tests on various servlet containers. We recently upgraded from 9.4.x (9-jre11 tag fro the jetty official docker image on dockerhub) to 10.0.0 (10.0.0-jre11) and are now getting the following error (https://ci.xwiki.org/job/XWiki/job/xwiki-platform/job/master/4309/testReport/junit/org.xwiki.administration.test.ui/AllITs$NestedXARImportIT/MariaDB_10_5__Jetty_10_0_0_jre11__Firefox___Docker_tests_for_xwiki_platform_administration___Build_for_MariaDB_10_5__Jetty_10_0_0_jre11__Firefox___Docker_tests_for_xwiki_platform_administration___testImportWhenImportAsBackupIsNotSelected_TestUtils__TestReference__TestConfiguration_/):

08:59:18.606 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT: 2021-02-18 08:59:18,604 [qtp863831416-20 - http://xwikiweb:8080/xwiki/bin/upload/XWiki/XWikiPreferences] ERROR c.x.x.w.Utils                  - Failed to process MultiPart request 
08:59:18.606 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT: com.xpn.xwiki.XWikiException: Error number 11008 in 11: Exception while getting uploaded files
08:59:18.606 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at com.xpn.xwiki.internal.fileupload.FileUploadUtils.getFileItems(FileUploadUtils.java:86)
08:59:18.606 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at com.xpn.xwiki.plugin.fileupload.FileUploadPlugin.loadFileList(FileUploadPlugin.java:213)
08:59:18.606 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at com.xpn.xwiki.plugin.fileupload.FileUploadPlugin.loadFileList(FileUploadPlugin.java:183)
08:59:18.606 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at com.xpn.xwiki.web.Utils.handleMultipart(Utils.java:614)
08:59:18.606 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:483)
08:59:18.606 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:258)
08:59:18.606 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at com.xpn.xwiki.web.LegacyActionServlet.service(LegacyActionServlet.java:106)
08:59:18.607 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
08:59:18.607 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1417)
08:59:18.607 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:761)
08:59:18.607 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1675)
08:59:18.607 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:122)
08:59:18.607 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:207)
08:59:18.607 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1650)
08:59:18.607 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.xwiki.wysiwyg.filter.ConversionFilter.doFilter(ConversionFilter.java:109)
08:59:18.607 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:207)
08:59:18.607 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1650)
08:59:18.607 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.xwiki.container.servlet.filters.internal.SetHTTPHeaderFilter.doFilter(SetHTTPHeaderFilter.java:63)
08:59:18.607 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:207)
08:59:18.607 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1650)
08:59:18.608 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208)
08:59:18.608 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:207)
08:59:18.608 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1650)
08:59:18.608 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111)
08:59:18.608 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:207)
08:59:18.608 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1650)
08:59:18.608 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.xwiki.resource.servlet.RoutingFilter.doFilter(RoutingFilter.java:132)
08:59:18.608 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:215)
08:59:18.608 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1650)
08:59:18.608 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.websocket.servlet.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:156)
08:59:18.608 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:207)
08:59:18.608 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1650)
08:59:18.609 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:515)
08:59:18.609 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:136)
08:59:18.609 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:585)
08:59:18.609 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
08:59:18.609 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:228)
08:59:18.609 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1576)
08:59:18.609 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:226)
08:59:18.609 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1358)
08:59:18.609 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:181)
08:59:18.609 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:472)
08:59:18.609 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1549)
08:59:18.609 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:179)
08:59:18.609 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1282)
08:59:18.609 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:134)
08:59:18.609 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:154)
08:59:18.610 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.server.handler.HandlerList.handle(HandlerList.java:56)
08:59:18.610 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
08:59:18.610 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.server.Server.handle(Server.java:567)
08:59:18.610 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.server.HttpChannel.lambda$handle$0(HttpChannel.java:404)
08:59:18.610 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:661)
08:59:18.610 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:396)
08:59:18.610 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:289)
08:59:18.610 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:324)
08:59:18.610 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
08:59:18.610 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.io.SocketChannelEndPoint$1.run(SocketChannelEndPoint.java:106)
08:59:18.610 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
08:59:18.610 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
08:59:18.610 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
08:59:18.610 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
08:59:18.610 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)
08:59:18.610 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:790)
08:59:18.610 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:912)
08:59:18.611 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at java.base/java.lang.Thread.run(Unknown Source)
08:59:18.611 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT: Caused by: java.lang.IllegalStateException: No multipart config for servlet
08:59:18.611 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.server.Request.getParts(Request.java:2242)
08:59:18.611 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.server.Request.getParts(Request.java:2233)
08:59:18.611 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at javax.servlet.http.HttpServletRequestWrapper.getParts(HttpServletRequestWrapper.java:317)
08:59:18.611 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at javax.servlet.http.HttpServletRequestWrapper.getParts(HttpServletRequestWrapper.java:317)
08:59:18.611 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at com.xpn.xwiki.internal.fileupload.FileUploadUtils.getFileItems(FileUploadUtils.java:84)
08:59:18.611 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    ... 64 common frames omitted

The root error is:

08:59:18.611 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT: Caused by: java.lang.IllegalStateException: No multipart config for servlet
08:59:18.611 [docker-java-stream--1643973962] INFO  o.x.t.d.i.j.s.ServletContainerExecutor - STDOUT:    at org.eclipse.jetty.server.Request.getParts(Request.java:2242)

Has some default config changed related to this in Jetty 10.0.0 over 9.4.x?

I read https://webtide.com/jetty-10-and-11-have-arrived/ but couldn't find any mention of this.

thanks a lot

joakime commented 3 years ago

The only change related to multipart is that the old / legacy (buggy!) multipart parser (the class that reads the InputStream) was removed in favor of the spec compliant parser (which has been present in Jetty since 9.2.x).

But that's a change that occurs at a later step in the process than you are hitting. The error you are getting is because the Servlet you in, that initiated the HttpServletRequest.getParts() call, doesn't have a Multipart Configuration (a requirement of the Servlet spec to be able to use that method). The next step (if the error didn't occur) would be to open the InputStream and start the processing of the multipart content.

What does your @MultipartConfig (or equivalent WEB-INF/web.xml section) look like for that servlet in your webapp? It looks like xwiki, can you point me to the config in your source control?

joakime commented 3 years ago

Looking at your LegacyActionServlet ...

https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-web/src/main/webapp/WEB-INF/web.xml#L236-L260

Your web.xml has no <multipart-config> configuration element for it.

Ok, lets look at your servlet itself for annotations ...

https://github.com/xwiki/xwiki-platform/blame/master/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/LegacyActionServlet.java#L54

@MultipartConfig
public class LegacyActionServlet extends HttpServlet
{

Yup, you have one, but it's unconfigured, not sure that is valid. @janbartel is this valid?

vmassol commented 3 years ago

@joakime wow fast answer :) Thanks.

You were even faster than me to find the xwiki code ;)

Ok so maybe it's more strict now (in 10.0.0) than before (9.4.x)?

joakime commented 3 years ago

Seems valid. But this could easily trigger if your server didn't have annotation processing turned on/enabled.

vmassol commented 3 years ago

But this could easily trigger if your server didn't have annotation processing turned on/enabled.

haha maybe that's the difference between the 9-jre11 tag and the 10.0.0-jre11 one on dockerhub.

EDIT: I see that the dockerfile just takes the jetty-home-$JETTY_VERSION.tar.gz file and unzips it (https://github.com/eclipse/jetty.docker/blob/master/10.0-jdk11/Dockerfile#L9). So I need to check if something has changed inside that tar gz.

vmassol commented 3 years ago

@joakime: I see the following changes between 9.4.36 and 10.0.0:

Screenshot 2021-02-18 at 16 16 48

So jetty-annotations.xml (see below for its content fro 9.4.36) was removed. Could that be it?

<?xml version="1.0"?><!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">

<Configure id="Server" class="org.eclipse.jetty.server.Server">
  <!-- =========================================================== -->
  <!-- Add annotation Configuring classes to all webapps for this Server -->
  <!-- =========================================================== -->
  <Call class="org.eclipse.jetty.webapp.Configuration$ClassList" name="setServerDefault">
    <Arg><Ref refid="Server" /></Arg>
    <Call name="addBefore">
      <Arg name="beforeClass">org.eclipse.jetty.webapp.JettyWebXmlConfiguration</Arg>
      <Arg>
        <Array type="String">
          <Item>org.eclipse.jetty.annotations.AnnotationConfiguration</Item>
        </Array>
      </Arg>
    </Call>
  </Call>

</Configure>
joakime commented 3 years ago

Looking at the configuration of the JETTY_BASE

Yeah, the annotations module is not in 10.

https://github.com/eclipse/jetty.docker/blob/master/10.0-jdk11/Dockerfile#L63-L66

vmassol commented 3 years ago

But it's not either in 9 (yet it works): https://github.com/eclipse/jetty.docker/blob/master/9.4-jre11/Dockerfile#L65-L66

10.0: --add-to-start="server,http,deploy,jsp,jstl,ext,resources,websocket" 9.4 --add-to-start="server,http,deploy,jsp,jstl,ext,resources,websocket"

It's basically the same.

vmassol commented 3 years ago

@joakime I see in jsp.mod for 10.0:

# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html

[description]
Enables JSP for all web applications deployed on the server.

[depend]
servlet
annotations
apache-jsp

Doesn't this mean that since jsp is in -add-to-start, that, transitively, annotations.mod will be included?

Thx

joakime commented 3 years ago

If you can run --list-config then that will be the ultimate truth on what is enabled or not.

vmassol commented 3 years ago

If you can run --list-config then that will be the ultimate truth on what is enabled or not.

Seems the annotation module is enabled.

@joakime is the fact that jetty-annotations.xml is no longer there (when compared to 9.4.x) a problem?

$ docker run  jetty:10.0.0-jre11 --list-config

Enabled Modules:
----------------
    0) resources       ${jetty.base}/start.d/resources.ini
    1) logging/slf4j   transitive provider of logging/slf4j for logging-jetty
                       dynamic dependency of logging-jetty
    2) logging-jetty   transitive provider of logging for threadpool
                       transitive provider of logging for bytebufferpool
                       transitive provider of logging for server
    3) bytebufferpool  transitive provider of bytebufferpool for server
                       init template available with --add-module=bytebufferpool
    4) ext             ${jetty.base}/start.d/ext.ini
    5) threadpool      transitive provider of threadpool for server
                       init template available with --add-module=threadpool
    6) server          ${jetty.base}/start.d/server.ini
    7) jndi            transitive provider of jndi for plus
    8) security        transitive provider of security for webapp
                       transitive provider of security for plus
    9) servlet         transitive provider of servlet for webapp
                       transitive provider of servlet for jsp
   10) webapp          transitive provider of webapp for plus
                       transitive provider of webapp for deploy
                       init template available with --add-module=webapp
   11) plus            transitive provider of plus for annotations
   12) annotations     transitive provider of annotations for websocket-jetty
                       transitive provider of annotations for jsp
                       transitive provider of annotations for websocket-javax
   13) apache-jsp      transitive provider of apache-jsp for jsp
   14) apache-jstl     transitive provider of apache-jstl for jstl
   15) client          transitive provider of client for websocket-javax
   16) deploy          ${jetty.base}/start.d/deploy.ini
   17) http            ${jetty.base}/start.d/http.ini
   18) jsp             ${jetty.base}/start.d/jsp.ini
   19) jstl            ${jetty.base}/start.d/jstl.ini
   20) websocket-javax transitive provider of websocket-javax for websocket
   21) websocket-jetty transitive provider of websocket-jetty for websocket
   22) websocket       ${jetty.base}/start.d/websocket.ini

Java Environment:
-----------------
 java.home = /usr/local/openjdk-11 (null)
 java.vm.vendor = Oracle Corporation (null)
 java.vm.version = 11.0.10+9 (null)
 java.vm.name = OpenJDK 64-Bit Server VM (null)
 java.vm.info = mixed mode, sharing (null)
 java.runtime.name = OpenJDK Runtime Environment (null)
 java.runtime.version = 11.0.10+9 (null)
 java.io.tmpdir = /tmp/jetty (null)
 user.dir = /var/lib/jetty (null)
 user.language = en (null)
 user.country = null (null)

Jetty Environment:
-----------------
 jetty.version = 10.0.0
 jetty.tag.version = master
 jetty.home = /usr/local/jetty
 jetty.base = /var/lib/jetty

Config Search Order:
--------------------
 <command-line>
 ${jetty.base} -> /var/lib/jetty
 ${jetty.home} -> /usr/local/jetty

JVM Arguments:
--------------
 (no jvm args specified)

System Properties:
------------------
 (no system properties specified)

Properties:
-----------
 java.version = 11.0.10
 java.version.major = 11
 java.version.micro = 10
 java.version.minor = 0
 java.version.platform = 11
 jetty.base = /var/lib/jetty
 jetty.base.uri = file:///var/lib/jetty
 jetty.home = /usr/local/jetty
 jetty.home.uri = file:///usr/local/jetty
 jetty.webapp.addServerClasses = org.eclipse.jetty.logging.,org.slf4j.
 slf4j.version = 2.0.0-alpha1

Jetty Server Classpath:
-----------------------
Version Information on 41 entries in the classpath.
Note: order presented here is how they would appear on the classpath.
      changes to the --module=name command line options will be reflected here.
 0:                    (dir) | ${jetty.base}/resources
 1:             2.0.0-alpha1 | ${jetty.home}/lib/logging/slf4j-api-2.0.0-alpha1.jar
 2:                   10.0.0 | ${jetty.home}/lib/logging/jetty-slf4j-impl-10.0.0.jar
 3:                    4.0.5 | ${jetty.home}/lib/jetty-servlet-api-4.0.5.jar
 4:                   10.0.0 | ${jetty.home}/lib/jetty-http-10.0.0.jar
 5:                   10.0.0 | ${jetty.home}/lib/jetty-server-10.0.0.jar
 6:                   10.0.0 | ${jetty.home}/lib/jetty-xml-10.0.0.jar
 7:                   10.0.0 | ${jetty.home}/lib/jetty-util-10.0.0.jar
 8:                   10.0.0 | ${jetty.home}/lib/jetty-io-10.0.0.jar
 9:                   10.0.0 | ${jetty.home}/lib/jetty-jndi-10.0.0.jar
10:                   10.0.0 | ${jetty.home}/lib/jetty-security-10.0.0.jar
11:                   10.0.0 | ${jetty.home}/lib/jetty-servlet-10.0.0.jar
12:                   10.0.0 | ${jetty.home}/lib/jetty-webapp-10.0.0.jar
13:                   10.0.0 | ${jetty.home}/lib/jetty-plus-10.0.0.jar
14:                    1.3.2 | ${jetty.home}/lib/jakarta.transaction-api-1.3.2.jar
15:                   10.0.0 | ${jetty.home}/lib/jetty-annotations-10.0.0.jar
16:                      9.0 | ${jetty.home}/lib/annotations/asm-9.0.jar
17:                      9.0 | ${jetty.home}/lib/annotations/asm-analysis-9.0.jar
18:                      9.0 | ${jetty.home}/lib/annotations/asm-commons-9.0.jar
19:                      9.0 | ${jetty.home}/lib/annotations/asm-tree-9.0.jar
20:                    1.3.5 | ${jetty.home}/lib/annotations/jakarta.annotation-api-1.3.5.jar
21:    3.19.0.v20190903-0936 | ${jetty.home}/lib/apache-jsp/org.eclipse.jdt.ecj-3.19.0.jar
22:                   10.0.0 | ${jetty.home}/lib/apache-jsp/org.eclipse.jetty.apache-jsp-10.0.0.jar
23:                   9.0.29 | ${jetty.home}/lib/apache-jsp/org.mortbay.jasper.apache-el-9.0.29.jar
24:                   9.0.29 | ${jetty.home}/lib/apache-jsp/org.mortbay.jasper.apache-jsp-9.0.29.jar
25:                    1.2.5 | ${jetty.home}/lib/apache-jstl/org.apache.taglibs.taglibs-standard-impl-1.2.5.jar
26:                    1.2.5 | ${jetty.home}/lib/apache-jstl/org.apache.taglibs.taglibs-standard-spec-1.2.5.jar
27:                   10.0.0 | ${jetty.home}/lib/jetty-client-10.0.0.jar
28:                   10.0.0 | ${jetty.home}/lib/jetty-alpn-client-10.0.0.jar
29:                   10.0.0 | ${jetty.home}/lib/jetty-deploy-10.0.0.jar
30:                   10.0.0 | ${jetty.home}/lib/websocket/websocket-core-common-10.0.0.jar
31:                   10.0.0 | ${jetty.home}/lib/websocket/websocket-core-client-10.0.0.jar
32:                   10.0.0 | ${jetty.home}/lib/websocket/websocket-core-server-10.0.0.jar
33:                   10.0.0 | ${jetty.home}/lib/websocket/websocket-servlet-10.0.0.jar
34:                    1.1.2 | ${jetty.home}/lib/websocket/jetty-javax-websocket-api-1.1.2.jar
35:                   10.0.0 | ${jetty.home}/lib/websocket/websocket-javax-client-10.0.0.jar
36:                   10.0.0 | ${jetty.home}/lib/websocket/websocket-javax-common-10.0.0.jar
37:                   10.0.0 | ${jetty.home}/lib/websocket/websocket-javax-server-10.0.0.jar
38:                   10.0.0 | ${jetty.home}/lib/websocket/websocket-jetty-api-10.0.0.jar
39:                   10.0.0 | ${jetty.home}/lib/websocket/websocket-jetty-common-10.0.0.jar
40:                   10.0.0 | ${jetty.home}/lib/websocket/websocket-jetty-server-10.0.0.jar

Jetty Active XMLs:
------------------
 ${jetty.home}/etc/jetty-bytebufferpool.xml
 ${jetty.home}/etc/jetty-threadpool.xml
 ${jetty.home}/etc/jetty.xml
 ${jetty.home}/etc/jetty-webapp.xml
 ${jetty.home}/etc/jetty-deploy.xml
 ${jetty.home}/etc/jetty-http.xml
joakime commented 3 years ago

Yeah, those look like normal configurations with annotations present. I think the annotation parsing angle is a red herring at this point, i'm going to ignore that path.

Now back to the default @MultipartConfig behavior. That looks fishy to my eyes, but could be valid. I'll be able to check that myself later (I'm a bit busy with other tasks ATM)

janbartel commented 3 years ago

The error java.lang.IllegalStateException: No multipart config for servlet only happens if the app has called Request.getParts() but there is either no @MultipartConfig annotation on the servlet nor the equivalent <multipart-config> element in web.xml. The annotation is detected by registering a jetty Decorator, which will introspect the Servlet to find the MultipartConfig annotation when the servlet instance is being commissioned. The equivalent element in web.xml is detected by the StandardDescriptorProcessor which parses web.xml. AFAIK nothing changed with either of those mechanisms between jetty 9.4 and 10.

As per the --list-config provided by @vmassol we can see that annotations are indeed configured

As for the bare @MultipartConfig annotation, ie with no configuration, I've tested that and it works fine.

So, going on the info we have in this issue, everything jetty-wise looks normal.

@vmassol -

It might be best if you attach the webapp so I can investigate further?

vmassol commented 3 years ago

@janbartel thanks a lot for your analysis and help, much appreciated!

Here's the latest webapp WAR: http://maven.xwiki.org/snapshots/org/xwiki/platform/xwiki-platform-distribution-war/13.2-SNAPSHOT/xwiki-platform-distribution-war-13.2-20210218.190056-6.war

does the LegacyActionServlet have the @MultipartConfig annotation on it directly, or is trying to inherit it?

It's on it directly: https://github.com/xwiki/xwiki-platform/blob/5b46d05e2be24f5c20b1b9ee3d3f8747c44806f6/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/LegacyActionServlet.java#L55

is the LegacyActionServlet added by web.xml, by annotation, by a fragment?

by web.xml, see https://github.com/xwiki/xwiki-platform/blob/f46d47d6c5fe2bfca32a1536163942e37e1d7054/xwiki-platform-core/xwiki-platform-web/src/main/webapp/WEB-INF/web.xml#L238

is the Request wrapped?

That's probably the case. I'm checking that right now. Will let you know.

has there been any change in the app, or is the version of jetty the only variable in this?

I confirm that the same code works fine in Jetty 9-jre11 and fails in 10.0.0-jre11 (those are the docker hub tags for the jetty official image).

Thanks!

janbartel commented 3 years ago

@vmassol thanks for the links. Unfortunately it looks like I can't just deploy that webapp in a jetty distribution - I get a lot of failures on startup like the following:

2021-02-19 12:31:57,493 [Core extension repository updater] ERROR aultExtensionRepositoryManager - Unexpected error when trying to find extension [org.eclipse.jetty:jetty-util/10.0.1-SNAPSHOT] in repository [extensions.xwiki.org:xwiki:https://extensions.xwiki.org/xwiki/rest] org.xwiki.extension.ResolveException: Failed to create extension object for extension [org.eclipse.jetty:jetty-util/10.0.1-SNAPSHOT] at org.xwiki.extension.repository.xwiki.internal.XWikiExtensionRepository.resolve(XWikiExtensionRepository.java:344) at org.xwiki.extension.repository.internal.DefaultExtensionRepositoryManager.resolve(DefaultExtensionRepositoryManager.java:286) at org.xwiki.extension.repository.internal.core.DefaultCoreExtensionScanner.updateExtensions(DefaultCoreExtensionScanner.java:123) at org.xwiki.extension.repository.internal.core.DefaultCoreExtensionRepository$1.run(DefaultCoreExtensionRepository.java:138) at java.base/java.lang.Thread.run(Thread.java:834) Caused by: java.io.IOException: Failed to request [https://extensions.xwiki.org/xwiki/rest/repository/extensions/org.eclipse.jetty%3Ajetty-util/versions/10.0.1-SNAPSHOT] at org.xwiki.extension.repository.xwiki.internal.XWikiExtensionRepository.getRESTResource(XWikiExtensionRepository.java:247) at org.xwiki.extension.repository.xwiki.internal.XWikiExtensionRepository.getRESTObject(XWikiExtensionRepository.java:305) at org.xwiki.extension.repository.xwiki.internal.XWikiExtensionRepository.resolve(XWikiExtensionRepository.java:350) at org.xwiki.extension.repository.xwiki.internal.XWikiExtensionRepository.resolve(XWikiExtensionRepository.java:340) ... 4 common frames omitted Caused by: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated

Is there anything else I can tweak or deploy that will make deploying the war work?

vmassol commented 3 years ago

Is there anything else I can tweak or deploy that will make deploying the war work?

What's working is using the jetty docker image. See https://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationWAR/InstallationJetty/

Specifically I just tested the WAR I pointed you to by doing:

$ docker run -v /tmp/xwiki:/var/lib/jetty/webapps/xwiki -p 8080:8080 jetty:10.0.0-jre11
2021-02-19 12:13:57.189:INFO :oejs.Server:main: jetty-10.0.0; built: 2020-12-02T21:06:43.949Z; git: b9645a17373e4e9b7f30b6c0a07defcea2cb660b; jvm 11.0.10+9
2021-02-19 12:13:57.306:INFO :oejdp.ScanningAppProvider:main: Deployment monitor [file:///var/lib/jetty/webapps/]
2021-02-19 12:14:10.510:INFO :oejss.DefaultSessionIdManager:main: Session workerName=node0
2021-02-19 12:14:45,354 [main] INFO  iPropertiesConfigurationSource - Loading [xwiki.properties] from [file:/var/lib/jetty/webapps/xwiki/WEB-INF/xwiki.properties] 
2021-02-19 12:14:46,470 [main] WARN  o.x.e.i.ServletEnvironment     - No permanent directory configured, fallbacking to temporary directory. You should set the "environment.permanentDirectory" configuration property in the xwiki.properties file. 
2021-02-19 12:14:46,470 [main] INFO  o.x.e.i.ServletEnvironment     - Using permanent directory [/tmp/jetty/jetty-0_0_0_0-8080-xwiki-_xwiki-any-18228227486151160480] 
2021-02-19 12:15:10,200 [main] WARN  .x.e.m.i.MavenExtensionScanner - Collision between core extension [org.eclipse.jetty:jetty-http/10.0.0 (jar:file:/usr/local/jetty/lib/jetty-http-10.0.0.jar!/META-INF/maven/org.eclipse.jetty/jetty-http/pom.xml)] and [org.eclipse.jetty:jetty-http/9.4.29.v20200521 (file:/var/lib/jetty/webapps/xwiki/WEB-INF/lib/jetty-http-9.4.29.v20200521.xed)] 
2021-02-19 12:15:10,201 [main] WARN  .x.e.m.i.MavenExtensionScanner - [org.eclipse.jetty:jetty-http/10.0.0 (jar:file:/usr/local/jetty/lib/jetty-http-10.0.0.jar!/META-INF/maven/org.eclipse.jetty/jetty-http/pom.xml)] is selected 
2021-02-19 12:15:10,312 [main] WARN  .x.e.m.i.MavenExtensionScanner - Collision between core extension [org.eclipse.jetty:jetty-util/10.0.0 (jar:file:/usr/local/jetty/lib/jetty-util-10.0.0.jar!/META-INF/maven/org.eclipse.jetty/jetty-util/pom.xml)] and [org.eclipse.jetty:jetty-util/9.4.29.v20200521 (file:/var/lib/jetty/webapps/xwiki/WEB-INF/lib/jetty-util-9.4.29.v20200521.xed)] 
2021-02-19 12:15:10,313 [main] WARN  .x.e.m.i.MavenExtensionScanner - [org.eclipse.jetty:jetty-util/10.0.0 (jar:file:/usr/local/jetty/lib/jetty-util-10.0.0.jar!/META-INF/maven/org.eclipse.jetty/jetty-util/pom.xml)] is selected 
2021-02-19 12:15:10,338 [main] WARN  .x.e.m.i.MavenExtensionScanner - Collision between core extension [org.eclipse.jetty:jetty-client/10.0.0 (jar:file:/usr/local/jetty/lib/jetty-client-10.0.0.jar!/META-INF/maven/org.eclipse.jetty/jetty-client/pom.xml)] and [org.eclipse.jetty:jetty-client/9.4.29.v20200521 (file:/var/lib/jetty/webapps/xwiki/WEB-INF/lib/jetty-client-9.4.29.v20200521.xed)] 
2021-02-19 12:15:10,339 [main] WARN  .x.e.m.i.MavenExtensionScanner - [org.eclipse.jetty:jetty-client/10.0.0 (jar:file:/usr/local/jetty/lib/jetty-client-10.0.0.jar!/META-INF/maven/org.eclipse.jetty/jetty-client/pom.xml)] is selected 
2021-02-19 12:15:10,342 [main] WARN  .x.e.m.i.MavenExtensionScanner - Collision between core extension [org.eclipse.jetty:jetty-alpn-client/10.0.0 (jar:file:/usr/local/jetty/lib/jetty-alpn-client-10.0.0.jar!/META-INF/maven/org.eclipse.jetty/jetty-alpn-client/pom.xml)] and [org.eclipse.jetty:jetty-alpn-client/9.4.29.v20200521 (file:/var/lib/jetty/webapps/xwiki/WEB-INF/lib/jetty-alpn-client-9.4.29.v20200521.xed)] 
2021-02-19 12:15:10,343 [main] WARN  .x.e.m.i.MavenExtensionScanner - [org.eclipse.jetty:jetty-alpn-client/10.0.0 (jar:file:/usr/local/jetty/lib/jetty-alpn-client-10.0.0.jar!/META-INF/maven/org.eclipse.jetty/jetty-alpn-client/pom.xml)] is selected 
2021-02-19 12:15:10,355 [main] WARN  .x.e.m.i.MavenExtensionScanner - Collision between core extension [jakarta.transaction:jakarta.transaction-api/1.3.2 (jar:file:/usr/local/jetty/lib/jakarta.transaction-api-1.3.2.jar!/META-INF/maven/jakarta.transaction/jakarta.transaction-api/pom.xml)] and [jakarta.transaction:jakarta.transaction-api/1.3.3 (file:/var/lib/jetty/webapps/xwiki/WEB-INF/lib/jakarta.transaction-api-1.3.3.xed)] 
2021-02-19 12:15:10,356 [main] WARN  .x.e.m.i.MavenExtensionScanner - [jakarta.transaction:jakarta.transaction-api/1.3.3 (file:/var/lib/jetty/webapps/xwiki/WEB-INF/lib/jakarta.transaction-api-1.3.3.xed)] is selected 
2021-02-19 12:15:10,363 [main] WARN  .x.e.m.i.MavenExtensionScanner - Collision between core extension [org.slf4j:slf4j-api/2.0.0-alpha1 (jar:file:/usr/local/jetty/lib/logging/slf4j-api-2.0.0-alpha1.jar!/META-INF/maven/org.slf4j/slf4j-api/pom.xml)] and [org.slf4j:slf4j-api/1.7.30 (file:/var/lib/jetty/webapps/xwiki/WEB-INF/lib/slf4j-api-1.7.30.xed)] 
2021-02-19 12:15:10,364 [main] WARN  .x.e.m.i.MavenExtensionScanner - [org.slf4j:slf4j-api/2.0.0-alpha1 (jar:file:/usr/local/jetty/lib/logging/slf4j-api-2.0.0-alpha1.jar!/META-INF/maven/org.slf4j/slf4j-api/pom.xml)] is selected 
2021-02-19 12:15:10,368 [main] WARN  .x.e.m.i.MavenExtensionScanner - Collision between core extension [org.eclipse.jetty:jetty-io/10.0.0 (jar:file:/usr/local/jetty/lib/jetty-io-10.0.0.jar!/META-INF/maven/org.eclipse.jetty/jetty-io/pom.xml)] and [org.eclipse.jetty:jetty-io/9.4.29.v20200521 (file:/var/lib/jetty/webapps/xwiki/WEB-INF/lib/jetty-io-9.4.29.v20200521.xed)] 
2021-02-19 12:15:10,368 [main] WARN  .x.e.m.i.MavenExtensionScanner - [org.eclipse.jetty:jetty-io/10.0.0 (jar:file:/usr/local/jetty/lib/jetty-io-10.0.0.jar!/META-INF/maven/org.eclipse.jetty/jetty-io/pom.xml)] is selected 
2021-02-19 12:15:20,963 [main] INFO  o.x.s.s.i.EmbeddedSolr         - Generating a new Solr home directory at [/tmp/jetty/jetty-0_0_0_0-8080-xwiki-_xwiki-any-18228227486151160480/store/solr] 
2021-02-19 12:15:21,112 [main] INFO  o.x.s.s.i.EmbeddedSolr         - Starting embedded Solr server... 
2021-02-19 12:15:21,112 [main] INFO  o.x.s.s.i.EmbeddedSolr         - Using Solr home directory: [/tmp/jetty/jetty-0_0_0_0-8080-xwiki-_xwiki-any-18228227486151160480/store/solr] 
2021-02-19 12:15:25,645 [main] WARN  o.e.j.u.s.S.config             - Trusting all certificates configured for Client@67e03fe4[provider=null,keyStore=null,trustStore=null] 
2021-02-19 12:15:25,645 [main] WARN  o.e.j.u.s.S.config             - No Client EndPointIdentificationAlgorithm configured for Client@67e03fe4[provider=null,keyStore=null,trustStore=null] 
2021-02-19 12:15:27,337 [main] WARN  o.e.j.u.s.S.config             - Trusting all certificates configured for Client@6bd21eb7[provider=null,keyStore=null,trustStore=null] 
2021-02-19 12:15:27,337 [main] WARN  o.e.j.u.s.S.config             - No Client EndPointIdentificationAlgorithm configured for Client@6bd21eb7[provider=null,keyStore=null,trustStore=null] 
2021-02-19 12:15:27,975 [main] WARN  o.a.s.c.CoreContainer          - Not all security plugins configured!  authentication=disabled authorization=disabled.  Solr is only as secure as you make it. Consider configuring authentication/authorization before exposing Solr to users internal or external.  See https://s.apache.org/solrsecurity for more info 
2021-02-19 12:15:50,307 [main] INFO  o.x.s.s.i.EmbeddedSolr         - Started embedded Solr server. 
2021-02-19 12:17:15,406 [main] INFO  o.x.s.f.i.FilesystemStoreTools - Using filesystem store directory [/tmp/jetty/jetty-0_0_0_0-8080-xwiki-_xwiki-any-18228227486151160480/store/file] 
2021-02-19 12:17:16.817:INFO :oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@397fbdb{XWiki,/xwiki,[file:///var/lib/jetty/webapps/xwiki/, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/jstree-3.3.8.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/colpick-2.0.2.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/font-awesome-4.7.0.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/html5shiv-3.7.2.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/bootstrap-daterangepicker-3.0.3.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/less-2.5.3.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/bootstrap-switch-3.3.2.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/jquery-ui-touch-punch-0.2.3-2.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/Eonasdan-bootstrap-datetimepicker-4.17.47.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/jquery-2.2.4.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/xwiki-platform-tree-webjar-13.2-SNAPSHOT.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/bootstrap-3.4.1.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/bootstrap-select-1.12.0.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/jquery-ui-1.11.4.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/url-search-params-polyfill-8.1.0.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/momentjs-2.24.0.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/Keypress-2.1.5.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/drawer-2.4.0.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/xwiki-platform-job-webjar-13.2-SNAPSHOT.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/iscroll-5.1.3.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/open-sans-1.1.0.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/xwiki-platform-captcha-jcaptcha-webjar-13.2-SNAPSHOT.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/moment-jdateformatparser-1.2.1.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/respond-1.4.2.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/selectize.js-0.12.5.jar!/META-INF/resources, jar:file:///var/lib/jetty/webapps/xwiki/WEB-INF/lib/requirejs-2.3.6.jar!/META-INF/resources],AVAILABLE}{/var/lib/jetty/webapps/xwiki}
2021-02-19 12:17:16.849:INFO :oejs.AbstractConnector:main: Started ServerConnector@60a1103d{HTTP/1.1, (http/1.1)}{0.0.0.0:8080}
2021-02-19 12:17:16.854:INFO :oejs.Server:main: Started Server@1a04f701{STARTING}[10.0.0,sto=5000] @200967ms

I'm not sure what Caused by: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated is about (first time I see this TBH)...

janbartel commented 3 years ago

@vmassol found it!

The problem is caused by a change to comply with the servlet specification and tck tests as regards annotations: according to the spec, if "metadata-complete==true" in web.xml, a servlet container is not permitted to look for any annotations, including @MultipartConfig. When metadata is complete, web.xml must completely define the webapp. In earlier versions of jetty, if web.xml is metadata complete, we did not discover annotation such as @WebServlet/Filter/Listener, but we did still honour annotations that can be found by introspecting a servlet defined in web.xml, such as @MultipartConfig.

The change is here: https://github.com/eclipse/jetty.project/pull/4587

The fix for you would be to declare the <multipart-config> element in web.xml and you should be good, regardless of whether metadata is complete or not.

vmassol commented 3 years ago

Another way of testing (which is what I'm doing) is to run one of the failing functional tests of xwiki:

vmassol commented 3 years ago

The fix for you would be to declare the element in web.xml and you should be good, regardless of whether metadata is complete or not.

@janbartel thanks so much! I'll try this now.

vmassol commented 3 years ago

BTW this means that Tomcat 9 is also not spec compliant since our tests pass on it even though we have "metadata-complete==true" ;)

vmassol commented 3 years ago

or maybe it is a change of spec in servlet 4.0?

vmassol commented 3 years ago

Answering to myself: yes it seems to be related to servlet 4.0 according to https://github.com/eclipse/jetty.project/pull/4587 (should have read this before replying...).

vmassol commented 3 years ago

I've now validated it as working. Thanks a lot to @joakime and @janbartel for your very fast answers and willingness to help out! You're great :)