From user-return-19663-archive-asf-public=cust-asf.ponee.io@karaf.apache.org Sun Nov 25 05:48:52 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 522EE18062B for ; Sun, 25 Nov 2018 05:48:52 +0100 (CET) Received: (qmail 79767 invoked by uid 500); 25 Nov 2018 04:48:51 -0000 Mailing-List: contact user-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@karaf.apache.org Delivered-To: mailing list user@karaf.apache.org Received: (qmail 79757 invoked by uid 99); 25 Nov 2018 04:48:51 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 25 Nov 2018 04:48:51 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id DC5A6C03A6 for ; Sun, 25 Nov 2018 04:48:50 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.3 X-Spam-Level: X-Spam-Status: No, score=0.3 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id UU-KcAOQ8IPw for ; Sun, 25 Nov 2018 04:48:48 +0000 (UTC) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id EFB895F1F3 for ; Sun, 25 Nov 2018 04:48:47 +0000 (UTC) X-Originating-IP: 82.238.224.4 Received: from [192.168.134.110] (bre91-1-82-238-224-4.fbx.proxad.net [82.238.224.4]) (Authenticated sender: jb@nanthrax.net) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id D1D121BF204 for ; Sun, 25 Nov 2018 04:48:40 +0000 (UTC) Subject: Re: Aries JAX-RS Whiteboard To: user@karaf.apache.org References: <1950092359.54530.1542901435741@webmail.123-reg.co.uk> <61CDF312-C706-4969-92A0-1C3DA82E2B4E@paremus.com> <147473051.56238.1542902463884@webmail.123-reg.co.uk> <67eb6bfa-1729-4e05-022f-d19253c21385@nanthrax.net> <1744174603.57710.1542903280687@webmail.123-reg.co.uk> <6443DE22-D32C-4F67-BEC6-45B08E592846@paremus.com> <1775931923.66615.1542910068599@webmail.123-reg.co.uk> <879311AC-4CC9-4973-B2AF-4A4E09E79389@paremus.com> <1903831040.153559.1543083873200@webmail.123-reg.co.uk> From: =?UTF-8?Q?Jean-Baptiste_Onofr=c3=a9?= Message-ID: <94e43b71-4598-3a9f-6ada-688873ee2181@nanthrax.net> Date: Sun, 25 Nov 2018 05:48:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <1903831040.153559.1543083873200@webmail.123-reg.co.uk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Hi Tom, I'm curious: what JAXRS API bundle do you use (that provide the JAXRS contract) ? Regards JB On 24/11/2018 19:24, tom@quarendon.net wrote: > >> The SSE from JAX-RS 2.1 definitely works (client and server side) with the Aries implementation, so hopefully that will give you everything that you need. > > I have it all working now. I've had to make one or two changes though, as a result of the change from jersey to cxf. > > Generally, the implementation was pretty easy, it certainly works to use Aries JAX-RS Whiteboard within Karaf 4.1.2. Once I worked out what the required dependency bundles were, it was OK. Anecdotally the requests seem faster than using jersey as well, though I haven't done any testing on that. > > I battled with an issue for a while because I had two bundles providing the jaxrs API. I had the original one, plus I also had the org.apache.aries.javax.jax.rs-api one (required as it adds a required OSGi contract specification). That caused me some issues with bundles sometimes working and sometimes reporting "exposed to package via two dependency chain" issues, and huge startup times and memory use while it figured it out. That took me a while to iron out. > > An issue I failed to resolve was that we had some use of jaxrs http client. I never did manage to get it to use the CXF client implementation. The Aries JAX-RS whiteboard bundles the required parts of CXF within it, but I don't think they are accessible to use. I tried including the relevant parts of CXF, but couldn't get it all to work. It seemed to be a bundle initialisation order issue, in that the geronimo osgi locator component was being used to find the JAX-RS http client classes before it had been initialised. Maybe if I'd just included the complete CXF bundle it would all have worked OK, but that seemed overkill when all I wanted was the client, and when the Aries JAX-RS whiteboard implementation includes its own copy of CXF as well. Since we only had one class using it I just substituted it for a non-jax-rs http client and the problem went away. > > I encountered an issue with Aries JAX-RS Whiteboard that I will raise on github. It doesn't like "void" resource method results. You get: > java.lang.NullPointerException > at > org.apache.aries.jax.rs.whiteboard.internal.cxf.PromiseAwareJAXRSInvoker.checkFutureResponse(PromiseAwareJAXRSInvoker.java:40) > > This has caused me a bit of rework to get round to be sure it was the problem. > > I also encountered a difference in behaviour between cxf and jersey. I had a resource component with a path of "/a", and another with a path of "/a/b". In CXF the second of these didn't seem to get matched. Instead I had to add a subresource locator method on the first to match "b" and return the second resource component. No big deal, and I don't actually know what the spec says is valid. I'm assuming that this is in CXF rather than the whiteboard. > > Apart from all of that, it worked fine. > Now to see whether it all actually solves the reliability issues we were having with our own homebrew whiteboard. > > Thanks for the assistance. > -- Jean-Baptiste Onofré jbonofre@apache.org http://blog.nanthrax.net Talend - http://www.talend.com