ASF Bugzilla – Attachment 25989 Details for
Bug 49884
NullPointerException in org.apache.catalina.core.AsyncContextImpl.doInternalComplete
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Servlet used to reproduce the problem
TestServlet.java (text/x-java), 1.57 KB, created by
Kevin
on 2010-09-04 23:24:22 UTC
(
hide
)
Description:
Servlet used to reproduce the problem
Filename:
MIME Type:
Creator:
Kevin
Created:
2010-09-04 23:24:22 UTC
Size:
1.57 KB
patch
obsolete
>import java.io.IOException; >import java.io.PrintWriter; >import java.util.concurrent.ExecutorService; >import java.util.concurrent.Executors; > >import javax.servlet.AsyncContext; >import javax.servlet.ServletException; >import javax.servlet.http.HttpServlet; >import javax.servlet.http.HttpServletRequest; >import javax.servlet.http.HttpServletResponse; > >public class TestServlet extends HttpServlet { > > private static final long serialVersionUID = 3265203880758796966L; > > private static ExecutorService executorService_; > > static { > executorService_ = Executors.newFixedThreadPool(10); > } > > @Override > protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { > final AsyncContext context = request.startAsync(); > executorService_.execute(new Worker(context)); > } > > private class Worker implements Runnable { > > private AsyncContext context_; > > public Worker(AsyncContext context) { > context_ = context; > } > > @Override > public void run() { > try { > HttpServletRequest request = (HttpServletRequest) context_.getRequest(); > HttpServletResponse response = (HttpServletResponse) context_.getResponse(); > service(request, response); > } catch (Throwable t) { > t.printStackTrace(); > } finally { > context_.complete(); > } > } > > protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { > response.setContentType("text/html"); > PrintWriter out = response.getWriter(); > out.println("Hello World"); > } > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 49884
: 25989 |
26022