Skip to content
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

NPE for servlet with no mapping #5555

Closed
gregw opened this issue Nov 2, 2020 · 1 comment · May be fixed by castuloramirez/java-docs-samples#8
Closed

NPE for servlet with no mapping #5555

gregw opened this issue Nov 2, 2020 · 1 comment · May be fixed by castuloramirez/java-docs-samples#8
Assignees
Labels
Bug For general bugs on Jetty side High Priority

Comments

@gregw
Copy link
Contributor

gregw commented Nov 2, 2020

Jetty version
9.4.33

Description

NPE if there exists a filter with a servlet name mapping, but a request is received for another servlet that has no filter with a servlet name match, then a NPE is generated when looking for servlet name matches for that servlet, because there are none.

java.lang.NullPointerException
	at org.eclipse.jetty.servlet.ServletHandler.getFilterChain(ServletHandler.java:617)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:527)
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:190)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
	at org.eclipse.jetty.server.Server.handle(Server.java:516)
	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:556)
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273)
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
	at org.eclipse.jetty.io.ByteArrayEndPoint$1.run(ByteArrayEndPoint.java:76)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:773)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:905)
	at java.base/java.lang.Thread.run(Thread.java:834)
@gregw gregw added High Priority Bug For general bugs on Jetty side labels Nov 2, 2020
@gregw gregw self-assigned this Nov 2, 2020
gregw added a commit that referenced this issue Nov 2, 2020
Fixed #5555 NPE if there is a filter with a servlet name mapping, but a request is received for a servlet without a name match.
Added more simple tests for servlet and filter mappings
@joakime
Copy link
Contributor

joakime commented Nov 2, 2020

wow, what release did this show up in?
I want to track down the commits that caused it, and see if there's any other things we missed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side High Priority
Projects
None yet
2 participants