-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attribute org.eclipse.jetty.multipartConfig is null #12650
Comments
@mperktold so far I can't seem to replicate this with jetty (without vaadin). I'm checking that after a forward (as indicated by the line number in the I downloaded your repo and ran that in IntelliJ, and hit the indicated home url, but I don't see anything referring to the multipart attribute on the output. I'm attaching the output log to this post. |
A follow up - I've been able to see the log output, but it only happens occasionally. In the debugger, it looks like it could be during the handling of this request:
|
Only return the org.eclipse.jetty.multipartConfig attribute name on getAttributeNames iff the servlet that is the target of the forward supports multipart.
A follow up to the follow up: I think there may be an anomaly with the way we calculate the applicable attribute names, vs the value of the attribute. It could be that we're deciding the It looks to me that the originating servlet is a Let me confirm that with a bit more investigation, it's very confusing with so much request wrapping and forwarding happening. Standby. |
See PR #12656 |
@janbartel Yes, that sounds very plausible. |
Jetty version(s)
12.0.15
Jetty Environment
ee10
Java version/vendor
(use: java -version)
openjdk version "21.0.5" 2024-10-15 LTS
OpenJDK Runtime Environment Temurin-21.0.5+11 (build 21.0.5+11-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.5+11 (build 21.0.5+11-LTS, mixed mode, sharing)
OS type/version
Windows 11
Description
When using a Vaadin starter with Jetty, the logs show the following warnings:
The log message comes from Atmosphere, which is used internally by Vaadin, but to me this seems like a Jetty issue. Atmosphere just cycles through all attributes to copy them into a local field: https://github.com/Atmosphere/atmosphere/blob/46faee5a497174d661e91683af5fad9c4b637f09/modules/cpr/src/main/java/org/atmosphere/cpr/AtmosphereRequestImpl.java#L1441-L1460
It doesn't expect that any attribute name returned by
request.getAttributeNames()
is mapped to a null value.And indeed, Jetty only includes this attribute if it there is a non-null value for it, because it uses an implementation of
Attributes.Synthetic
to add this attribute to the ones of the underlying request:jetty.project/jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/ServletContextRequest.java
Lines 135 to 158 in 5901f71
The base class should take care of not including the attribute if its value is null.
However, when Atmosphere fetches the values for each attribute name, it ends up in a different code, and in a different instance of
ServletHolder
, where the value is indeed null:jetty.project/jetty-ee10/jetty-ee10-servlet/src/main/java/org/eclipse/jetty/ee10/servlet/Dispatcher.java
Line 369 in 5901f71
How to reproduce?
I've created a repository here: https://github.com/mperktold/hello-vaadin
You can simply start the application and open it in your browser, and you should immediately see the warning in the logs.
The application is a basic Vaadin starter where
spring-boot-starter-tomcat
is replaced withspring-boot-starter-jetty
.The text was updated successfully, but these errors were encountered: