Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5CF82181A8 for ; Tue, 21 Jul 2015 15:34:17 +0000 (UTC) Received: (qmail 73887 invoked by uid 500); 21 Jul 2015 15:33:43 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 73840 invoked by uid 500); 21 Jul 2015 15:33:43 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 73828 invoked by uid 99); 21 Jul 2015 15:33:42 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jul 2015 15:33:42 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 3919B18ACC5 for ; Tue, 21 Jul 2015 15:33:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.901 X-Spam-Level: ** X-Spam-Status: No, score=2.901 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id DkR02K2pm_5Y for ; Tue, 21 Jul 2015 15:33:29 +0000 (UTC) Received: from mail-wg0-f42.google.com (mail-wg0-f42.google.com [74.125.82.42]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id EC57223117 for ; Tue, 21 Jul 2015 15:33:28 +0000 (UTC) Received: by wgkl9 with SMTP id l9so159637252wgk.1 for ; Tue, 21 Jul 2015 08:33:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-type; bh=7R3V33BOHnPPdB01E0MXPpjRRaRIssYwy2KAoi9qrpU=; b=NZTj4xPr+hSHB3WTtUybxgaZoq+F/G2aOhdl0H4ZceemfgXOOr18CrMT0Tg6F/u10L FACNPPIY3475v7HshyrV/NHoiZ4OfuW4Nq9me88Vuwwscmb6rE0wONWBGawP7pp9O9jx PKovr8lr7CGZxeBMBTcRhX95iAvRuqfvA8pmeCrRommjB+iurYdWOd+EFANRsjVr0vgW HeS8W9OZR86zyLcAGCBIwufugzhyIsOM3Ow7r2jHjoRkhanE1DciMOFu4mEy6goGOPDX rB+eD+T1uIq7CkqQg4URo0+hhj/DzsPvfs0RXsQhNeTa88ir2IiBg3msM5lLD+h4BXaO SLlg== X-Received: by 10.180.76.202 with SMTP id m10mr33040684wiw.63.1437492808677; Tue, 21 Jul 2015 08:33:28 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Arnaud Deprez Date: Tue, 21 Jul 2015 15:33:19 +0000 Message-ID: Subject: Re: camel-swagger in karaf To: ed@edjusted.com, users Content-Type: multipart/alternative; boundary=f46d043c7c543a7d75051b6460ce --f46d043c7c543a7d75051b6460ce Content-Type: text/plain; charset=UTF-8 I just raised an issue for this : https://issues.apache.org/jira/browse/CAMEL-8993 On Tue, Jul 21, 2015 at 5:24 PM Arnaud Deprez wrote: > Thanks Ed, > Until your message I though I was the only one who is trying this. > > I also think it's a classpath issue because as I said, I don't reach this > issue with spring-boot. > > The following may help to diagnostic the problem. I put all the logs in > TRACE while I'm performing the request from the swagger-ui to retrieve the > documentation : > > 2015-07-21 15:18:05,787 | DEBUG | mel/api/api-docs | ServletHandler > | 58 - org.eclipse.jetty.aggregate.jetty-all-server - > 8.1.17.v20150415 | chain=null > 2015-07-21 15:18:05,787 | TRACE | mel/api/api-docs | > RestSwaggerApiDeclarationServlet | 166 - org.apache.camel.camel-swagger - > 2.15.2 | renderResourceListing > 2015-07-21 15:18:05,787 | DEBUG | mel/api/api-docs | mbeanserver > | - - | name = > org.apache.camel:context=be.arndep.camel.account-core,type=context,name="bankAccounts-rest" > 2015-07-21 15:18:05,788 | DEBUG | mel/api/api-docs | modelmbean > | - - | Entry > 2015-07-21 15:18:05,788 | DEBUG | mel/api/api-docs | modelmbean > | - - | Finding operation dumpRestsAsXml as dumpRestsAsXml > 2015-07-21 15:18:05,788 | DEBUG | mel/api/api-docs | modelmbean > | - - | Entry > 2015-07-21 15:18:05,788 | DEBUG | mel/api/api-docs | modelmbean > | - - | Entry > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Constructor > 2015-07-21 15:18:05,788 | DEBUG | mel/api/api-docs | modelmbean > | - - | Null Descriptor, creating new. > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Returns 'null' > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Entry: setting 'name' to 'dumpRestsAsXml' > 2015-07-21 15:18:05,788 | DEBUG | mel/api/api-docs | modelmbean > | - - | Defaulting Descriptor name to dumpRestsAsXml > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Returns 'null' > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Entry: setting 'descriptorType' to 'operation' > 2015-07-21 15:18:05,788 | DEBUG | mel/api/api-docs | modelmbean > | - - | Defaulting descriptorType to "operation" > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Returns 'null' > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Entry: setting 'displayName' to 'dumpRestsAsXml' > 2015-07-21 15:18:05,788 | DEBUG | mel/api/api-docs | modelmbean > | - - | Defaulting Descriptor displayName to dumpRestsAsXml > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Returns 'null' > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Entry: setting 'role' to 'operation' > 2015-07-21 15:18:05,788 | DEBUG | mel/api/api-docs | modelmbean > | - - | Defaulting Descriptor role field to "operation" > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Entry > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Returns 'dumpRestsAsXml' > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Returns 'operation' > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Returns true > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Returns 'dumpRestsAsXml' > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Returns 'operation' > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Returns 'operation' > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Returns 'null' > 2015-07-21 15:18:05,788 | DEBUG | mel/api/api-docs | modelmbean > | - - | Entry > 2015-07-21 15:18:05,788 | DEBUG | mel/api/api-docs | modelmbean > | - - | Entry > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Entry > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Constructor > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Entry > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Constructor > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Returns 'dumpRestsAsXml' > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Returns 'operation' > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Entry > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Returns 'dumpRestsAsXml' > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Returns 'operation' > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Returns true > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Returns 'dumpRestsAsXml' > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Returns 'operation' > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Returns 'operation' > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Returns 'null' > 2015-07-21 15:18:05,788 | DEBUG | mel/api/api-docs | modelmbean > | - - | Exit > 2015-07-21 15:18:05,788 | DEBUG | mel/api/api-docs | modelmbean > | - - | Entry > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Entry > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Constructor > 2015-07-21 15:18:05,788 | DEBUG | mel/api/api-docs | modelmbean > | - - | Entry > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Entry > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Entry > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Returning 5 fields > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Exit > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Printing 5 fields > 2015-07-21 15:18:05,788 | TRACE | mel/api/api-docs | modelmbean > | - - | Exit returning descriptorType=operation, > displayName=dumpRestsAsXml, mask=false, name=dumpRestsAsXml, role= > operation > > As you can see, I have a lot of Returns 'null' from modelmbean. > > Regards, > > A. > > On Mon, Jul 20, 2015 at 7:14 PM Ed Welch wrote: > >> A few months back I played around with swagger in camel, I think I made >> it about to where you were and either got pulled into another project or my >> short attention span got the better of me, because I never found a solution >> to this. >> >> I think the problem you are seeing with Karaf is likely a classpath >> issue, basically the swagger/jackson/camel bundles all have separate >> classloaders and this causes some issues when trying to get the swagger api >> to present your model. >> >> Unfortunately, this isn't really an easy problem to solve (assuming my >> guess is correct), you could possibly use a fragment bundle on either the >> swagger or jackson bundles (not sure which needs the classes), or consider >> some form of embed-dependency (which is not really the correct solution to >> an osgi problem) >> >> Sorry I can't be of more direct help, but I just wanted to point this out >> as a possible source of your issue. >> >> Regards, >> Ed >> >> On Mon, 20 Jul 2015 15:24:38 +0000, Arnaud Deprez >> wrote: >> >> > Hi again, >> > >> > I just push my example here which works fine with spring-boot but still >> > can't see the model in Karaf. >> > https://github.com/arnaud-deprez/camel-examples/tree/master/rest >> > >> > There are also the features I use. >> > If someone find what's wrong, I'd be verry happy ! :-) >> > >> > On Thu, Jul 16, 2015 at 1:46 PM Arnaud Deprez >> wrote: >> > >> > > It was plain pojos, but I just test it by adding the annotation >> @ApiModel >> > > and @ApiModelProperty on my pojos and it's still doesn't work. >> > > >> > > On Thu, Jul 16, 2015 at 1:18 PM Claus Ibsen >> wrote: >> > > >> > >> Hi >> > >> >> > >> Ah okay is your model annotate with swagger annotations or just plain >> > >> pojos? >> > >> >> > >> On Thu, Jul 16, 2015 at 1:10 PM, Arnaud Deprez < >> arnaudeprez@gmail.com> >> > >> wrote: >> > >> > Hi, >> > >> > >> > >> > Thanks for your quick answer. >> > >> > >> > >> > I've tried to add either a file org.apache.camel.cfg and >> > >> > jmx.acl.org.apache.camel.cfg that has * = * and I still have the >> same >> > >> > issue, even after restarting my karaf. >> > >> > >> > >> > On Thu, Jul 16, 2015 at 12:32 PM Claus Ibsen < >> claus.ibsen@gmail.com> >> > >> wrote: >> > >> > >> > >> >> Hi >> > >> >> >> > >> >> Also I remember one of the problems was the new RBAC in karaf, so >> you >> > >> >> need to bypass that so swagger can get the model from camel >> > >> >> >> > >> >> We are doing this out of the box in a future release >> > >> >> >> > >> >> >> > >> >> https://github.com/apache/camel/commit/dcdc7760ad4b382bb6e197190443e48e6ff2cdd7 >> > >> >> >> > >> >> But for current you need to setup this manually in karaf rbac. >> Its a >> > >> >> bit confusing to do so, but look in the etc dir and create a file >> that >> > >> >> starts with org.apache.camel and has that * = * >> > >> >> >> > >> >> >> > >> >> >> > >> >> On Thu, Jul 16, 2015 at 12:19 PM, Claus Ibsen < >> claus.ibsen@gmail.com> >> > >> >> wrote: >> > >> >> > Hi >> > >> >> > >> > >> >> > A while back there was a thread about swagger on karaf. Can you >> find >> > >> >> > that I think it has some pointers to get it working. >> > >> >> > >> > >> >> > >> > >> >> > >> > >> >> > On Thu, Jul 16, 2015 at 11:48 AM, Arnaud Deprez < >> > >> arnaudeprez@gmail.com> >> > >> >> wrote: >> > >> >> >> Hi guys, >> > >> >> >> >> > >> >> >> I don't know if this mail is for camel folks or karaf folks. >> > >> >> >> >> > >> >> >> I'm using camel 2.15.2 with its REST DSL and camel-swagger in >> an >> > >> OSGi >> > >> >> >> environment (I tried both karaf 2.4.3 and karaf 4). >> > >> >> >> >> > >> >> >> I'm using the servlet component by exposing it as OSGi >> services : >> > >> >> >> >> > >> >> >> - CamelHttpTransportServlet for my camel route >> > >> >> >> - DefaultCamelSwaggerServlet for the swagger documentation. >> > >> >> >> >> > >> >> >> Then I use the swagger ui to see the documentation. >> > >> >> >> >> > >> >> >> I can see my rest endpoint and the documentation I put in >> > >> "description" >> > >> >> but >> > >> >> >> it's not able to show me the model for the request and the >> response >> > >> >> >> (defined in "type" and "outType"). >> > >> >> >> >> > >> >> >> However if I use the same routes and the same servlet in a >> > >> spring-boot >> > >> >> >> environment, it works like a charm. >> > >> >> >> >> > >> >> >> I tried to find some information on the web but I didn't find >> > >> anything >> > >> >> >> about missing supports or bug with karaf and camel and the >> latest >> > >> >> version. >> > >> >> >> >> > >> >> >> So is it a known bug ? Or camel will support it in future >> version ? >> > >> Or >> > >> >> is >> > >> >> >> it a lack of support in karaf ? >> > >> >> >> >> > >> >> >> Regards, >> > >> >> >> >> > >> >> >> A. >> > >> >> > >> > >> >> > >> > >> >> > >> > >> >> > -- >> > >> >> > Claus Ibsen >> > >> >> > ----------------- >> > >> >> > http://davsclaus.com @davsclaus >> > >> >> > Camel in Action 2nd edition: http://www.manning.com/ibsen2 >> > >> >> >> > >> >> >> > >> >> >> > >> >> -- >> > >> >> Claus Ibsen >> > >> >> ----------------- >> > >> >> http://davsclaus.com @davsclaus >> > >> >> Camel in Action 2nd edition: http://www.manning.com/ibsen2 >> > >> >> >> > >> >> > >> >> > >> >> > >> -- >> > >> Claus Ibsen >> > >> ----------------- >> > >> http://davsclaus.com @davsclaus >> > >> Camel in Action 2nd edition: http://www.manning.com/ibsen2 >> > >> >> > > >> >> >> --f46d043c7c543a7d75051b6460ce--