Return-Path: X-Original-To: apmail-cxf-dev-archive@www.apache.org Delivered-To: apmail-cxf-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BBDFD11736 for ; Sat, 13 Sep 2014 07:32:38 +0000 (UTC) Received: (qmail 33123 invoked by uid 500); 13 Sep 2014 07:32:38 -0000 Delivered-To: apmail-cxf-dev-archive@cxf.apache.org Received: (qmail 33048 invoked by uid 500); 13 Sep 2014 07:32:38 -0000 Mailing-List: contact dev-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list dev@cxf.apache.org Received: (qmail 33035 invoked by uid 99); 13 Sep 2014 07:32:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 13 Sep 2014 07:32:38 +0000 X-ASF-Spam-Status: No, hits=2.3 required=5.0 tests=SPF_SOFTFAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of irisdingbj@gmail.com does not designate 216.139.236.26 as permitted sender) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 13 Sep 2014 07:32:33 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1XShob-0007vf-3f for dev@cxf.apache.org; Sat, 13 Sep 2014 00:32:13 -0700 Date: Sat, 13 Sep 2014 00:32:13 -0700 (PDT) From: iris ding To: dev@cxf.apache.org Message-ID: <1410593533102-5748709.post@n5.nabble.com> Subject: CXF fails to find a correct MessageBodyWritter for List if Resource method is defined under async way MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Guys, CXF fails to find a correct MessageBodyWritter for List if Resource method is defined under async way, see below example, I have two methods defined, the **/collecitons can be returned successfully however we will get an error for the **/asyncCollections. @Path("/bookstore") public class BookContinuationStore { private final List bookList = new ArrayList(); public BookContinuationStore() { init(); } @GET @Path("/collections") @Produces( { "application/xml", "application/json" }) public List getBookCollection() throws Exception { return bookList; } @GET @Path("/asyncCollections") @Produces({ "application/xml", "application/json" } ) public void getBookCollection(@Suspended AsyncResponse response) throws Exception { resumeSuspendedBookList(response); } private void resumeSuspendedBookList(final AsyncResponse response) { executor.execute(new Runnable() { @Override public void run() { try { Thread.sleep(2000); } catch (InterruptedException ex) { // ignore } response.resume(bookList); } }); } private void init() { Book b1 = new Book("Iris1", 1); Book b2 = new Book("Iris2", 2); bookList.add(b1); bookList.add(b2); } } I have opened CXF-6001 for this issue and uploaded a proposed fix. Looking forward to your comments! Iris Ding -- View this message in context: http://cxf.547215.n5.nabble.com/CXF-fails-to-find-a-correct-MessageBodyWritter-for-List-E-if-Resource-method-is-defined-under-async-y-tp5748709.html Sent from the cxf-dev mailing list archive at Nabble.com.