-
Notifications
You must be signed in to change notification settings - Fork 867
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
Fix NullPointerException on tomcat #3705
Conversation
@@ -31,8 +31,6 @@ public void addRequestAsyncListener( | |||
request | |||
.getAsyncContext() | |||
.addListener(new Listener(listener), request, (HttpServletResponse) response); | |||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed this branch to make tests fail when response
is null
|
||
transformer.applyAdviceToMethod( | ||
isMethod() | ||
.and(named("postParseRequest")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adapter
doesn't have this method. Is there any reason why we're not instrumenting CoyoteAdapter
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Didn't even realize that it wasn't using CoyoteAdapter
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx
Resolves #3673
We store response in a request attribute and use it later to add async completion listener. Currently on tomcat we touch request a bit too early when it ins't fully initialized. Either
org.apache.coyote.Request
doesn't have a reference toHttpServletRequest
in which case we just don't link response to request ororg.apache.coyote.Request
has reference toHttpServletRequest
which is empty (request was recycled, reusing a previous request) in which case depending on tomcat version we could get aNullPointerException
.