-
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
Http1FieldPreEncoder not loaded/invalid array index in PreEncodedHttpField #1325
Comments
Update: I have narrowed the issue down to how my JAR file is packed. However, the code sample above contains a potential for a bug, so the indexing should still be fixed. |
if you use Osgi environment maybe it look like #262 |
Issue #705 has more information about OSGi + ServiceLoader + ClassLoaders |
@janoszen if you are repacking dependencies, you have to make sure that Your fix would avoid the exception, but the exception itself is revealing of the underlying error, so it is better to fail fast rather than avoid the exception and have a non-working system. If it's not OSGi or repacking, reopen the issue. |
I have run across an interesting scenario with Jetty Embedded in relation to HTTP/2.
What's happening
When I run my application with the
GzipHandler
enabled, I get anExceptionInInitializerError
, which comes fromPreEncodedHttpField
. The exception itself is the result of anArrayIndexOutOfBoundsException
thrown inPreEncodedHttpField
line 70:The reason for this exception is that in my case, only the
HpackFieldPreEncoder
encoder seems to be loaded, which is incorrectly placed on index 0 instead of index 1. TheHttp1FieldPreEncoder
class is, for some reason, not loaded.Reproducing
Jetty dependencies:
Code:
Suggested fix
In line 57, the
index()
function should be used to explicitly specify the index the encoder is inserted in:The text was updated successfully, but these errors were encountered: