Comments (5)
@joakime Thanks for opening this and #82.
In Jetty 9.2.14, we throw a IllegalStateException, which isn't what Spring is expecting.
It's not so much the Spring doesn't expect an IllegalStateException, but that the exception doesn't happen at the same time as it does when using Tomcat. Very early in the handling of a request, DispatcherServlet
tries to create a StandardMultipartHttpServletRequest
. It tries to retrieve all of the request's parts. Any exception that's thrown at this stage will be wrapped in a MultipartException
. Tomcat throws an exception at this point but Jetty does not.
from jetty.project.
Related bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=455655
Jetty parses the multipart data either when one of the Request.getParameter/s() methods are called, or when Request.getParts() is called. If an exception happens during the parsing as a result of calling Request.getParameter/s() it was difficult to communicate that back to the client, due to the signature of getParameter/s(), so we added a throw of a RuntimeException to wrap the real exception.
So to clarify, I expect the current behaviour for jetty to be:
- if parsing initiated on a call to getParameter/s() then log the Exception and throw it wrapped in a RuntimeException. Subsequent calls to getParameter/s() will not throw, and neither would subsequent calls to getPart/s().
- if parsing initiated on a call to getPart/s() then an exception would be thrown. Subsequent calls to getPart/s() or getParameter/s() would not throw an exception.
So if I understand the bug report correctly, you're asking that if an exception occurs during multipart parsing, you want that exception returned every time getPart/s() is called? So that even if your code causes the parsing by calling getParameter/s() initially and the RuntimeException is thrown, your code is still likely to go on to call getPart/s() and you want the IOException or ServletException at that time, yes?
from jetty.project.
Assuming my understanding of the issue is correct as per my previous message, I've pushed a fix for this to the jetty-9.3.x branch: 11d3448
If you'd like to test it out, that would be great.
from jetty.project.
The bug was reported against Jetty 9.2.x, can this fix be cherry-picked back to the jetty-9.2.x branch?
from jetty.project.
@janbartel The latest 9.3.8 snapshot looks good. Thank you. The IllegalStateException
is now thrown as part of Spring's DispatcherServlet's checkMultipart processing which gives it a chance to catch it and wrap it in a MultipartException.
from jetty.project.
Related Issues (20)
- Jetty 12.0.6: NPE in error handling leading to 100% cpu usage by Jetty threads HOT 5
- Review number of acceptor threads HOT 6
- resolve differences in EE9/EE10/Core AliasCheckerSymlinkTests
- Quote escaping in HTML file HOT 2
- HTTP2 client: `InputStreamResponseListener.onContentSource()` throws NPE if `Response.abort()` was called in `onBegin()`
- Deadlock ReentrantLock$NonfairSync inbetween two threads HOT 1
- UriCompliance.Violation ignored despite being set HOT 18
- Problem adding a Mime Mapping for "*.js.gz" (IllegalArgumentException: extensions cannot contain '.') HOT 3
- URIUtil works in combination with UriCompliance HOT 4
- Flaky Test: org.eclipse.jetty.ee10.test.HttpInputIntegrationTest.testOne([8])
- restricting to TLS1.2V for client calls to AWS HOT 4
- Cannot invoke "org.eclipse.jetty.util.compression.CompressionPool$Entry.get()" because "this.this$0._deflaterEntry" is null HOT 3
- EOF error while closing not fully consumed ContentSourceInputStream HOT 4
- Is there a full migration guide or support channel for Jetty 11 to Jetty 12? HOT 7
- Flaky test `org.eclipse.jetty.test.client.transport.ServerTimeoutsTest.testIdleTimeout(Transport, boolean)[3] H2C, false`
- Flaky test `org.eclipse.jetty.ee9.session.DuplicateCookieTest.testMultipleSessionCookiesInvalidFirst`
- Flaky test `org.eclipse.jetty.ee10.servlet.ServletTest.testSimpleIdleRead` HOT 1
- HttpURI.toURI() sets userInfo to null HOT 1
- Is there a servlet -> core adapter? HOT 7
- Jetty Release 12.0.7 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jetty.project.