Hello, I have a AsyncListener registered for an AsyncContext. Everytime I call AsyncContext#complete fist onError gets called (throwable is null) and then onComplete().
Is this a known Bug or did I made something wrong? Here is the relevant Code: member vars: private final Queue<AsyncContext> queue = new ConcurrentLinkedQueue<AsyncContext>(); private ScheduledExecutorService s = Executors.newScheduledThreadPool(2); in doGet: final AsyncContext ac = req.startAsync(); ac.setTimeout(1 * 60 * 1000); ac.addListener(new AsyncListener() { public void onComplete(AsyncEvent event) throws IOException { queue.remove(ac); } public void onTimeout(AsyncEvent event) throws IOException { queue.remove(ac); } public void onError(AsyncEvent event) throws IOException { queue.remove(ac); } public void onStartAsync(AsyncEvent event) throws IOException { } }); queue.add(ac); in doPost I call notify("some message"): private void notify(final String cMessage) throws IOException { s.schedule(new Runnable() { @Override public void run() { for (AsyncContext ac : queue) { try { PrintWriter acWriter = ac.getResponse().getWriter(); acWriter.println(cMessage); acWriter.flush(); ac.complete() } catch (IOException ex) { System.out.println(ex); queue.remove(ac); } } } }, 3, TimeUnit.SECONDS); } Thank you --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org