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 757FD1096C for ; Tue, 4 Nov 2014 15:47:21 +0000 (UTC) Received: (qmail 3627 invoked by uid 500); 4 Nov 2014 15:47:20 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 3574 invoked by uid 500); 4 Nov 2014 15:47:20 -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 3561 invoked by uid 99); 4 Nov 2014 15:47:20 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Nov 2014 15:47:20 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of contactreji@gmail.com designates 209.85.218.51 as permitted sender) Received: from [209.85.218.51] (HELO mail-oi0-f51.google.com) (209.85.218.51) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Nov 2014 15:46:54 +0000 Received: by mail-oi0-f51.google.com with SMTP id g201so10529996oib.38 for ; Tue, 04 Nov 2014 07:44:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=BbzrrWjBUO4aExoy1goygNQpTODIe1Y0naNQtrhhqnc=; b=Ezd7juOHrhcg19gCIP39atI8wRGywBygnCBzYvLvzYlvMgJFtuIVohBjs5Z5gNIgt9 an9RFQsAhRxEU2rACIjE01sTig4iVvr5kL19b4p26DIR+GpDsuDkmfMQ5l1xQgZ18z4y BR821KNczEhS43etN48Dlo4mAHYn7Jaq3UFrZT0OxAmAoabDT114A9ctfuf3FNnUFCJq adMRuMpFCHQgakqAEXt9Aw7FEw9Q1rAMvhnkYFXU5F8vIjkh4YJ8Ne2dJnwP7xYWn5Le JIUZpLBuc9XCh3RqqbaSpE+TecT31TxOUzFvZeUCj5/BPBl6H2k/Xba3bcv57kl8mqHp dY3Q== MIME-Version: 1.0 X-Received: by 10.182.133.104 with SMTP id pb8mr1114099obb.81.1415115878298; Tue, 04 Nov 2014 07:44:38 -0800 (PST) Received: by 10.76.156.7 with HTTP; Tue, 4 Nov 2014 07:44:38 -0800 (PST) In-Reply-To: References: Date: Tue, 4 Nov 2014 21:14:38 +0530 Message-ID: Subject: Re: Configuring a servlet with camel-jetty From: Reji Mathews To: users@camel.apache.org Content-Type: multipart/alternative; boundary=e89a8ff1ce223dffa905070a57e0 X-Virus-Checked: Checked by ClamAV on apache.org --e89a8ff1ce223dffa905070a57e0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I guess for Jetty, internally there must be a servlet acting at back. Or probably set some option to get it up and running. Just got some clue from http://camel.apache.org/jetty.html . Alternatively http://camel.apache.org/servlet.html can help too. Reji On Tue, Nov 4, 2014 at 4:42 PM, jack atwork wrote: > Hi Willem, > > Can you provide any more information about this? Do you know if there is = a > way to configure servlets using camel-jetty or is it simply not possible? > I'd really appreciate any insight you have into this. > > Thanks, > > Jack > > On 31 October 2014 11:02, jack atwork wrote: > > > Thanks for the reply! > > > > I'm using the rest-dsl with camel-jetty and trying to integrate this wi= th > > the camel-swagger to provide the api docs. Camel-swagger only provides = a > > servlet. So my hope was to reuse camel-jetty to expose this servlet. > > > > Do you know if it is possible to register servlets with the camel-jetty > > component using another method? > > > > Thanks, > > > > Jack > > > > On 31 October 2014 01:15, Willem Jiang wrote: > > > >> Can you explain why you need a setup a servlet for the camel-jetty > >> component? > >> As camel-jetty setup the ServletContextHandler by itself, it doesn=E2= =80=99t > >> support you to do it that way. > >> > >> -- > >> Willem Jiang > >> > >> Red Hat, Inc. > >> Web: http://www.redhat.com > >> Blog: http://willemjiang.blogspot.com (English) > >> http://jnn.iteye.com (Chinese) > >> Twitter: willemjiang > >> Weibo: =E5=A7=9C=E5=AE=81willem > >> > >> > >> > >> On October 30, 2014 at 7:12:33 PM, jack atwork (jrmpatwork@gmail.com) > >> wrote: > >> > It's contributed via spring. I can see this part is fine because if = I > >> > misconfigure the id with something like 'MyUnregisteredContextHandle= r' > >> then > >> > I get a NoSuchBeanException when the camelContext is created. > >> > > >> > Does anybody know of any examples of setting up a servlet with > >> camel-jetty? > >> > If I add a filter to the handler I can see it gets executed on > requests > >> but > >> > for some reason any servlets I add never get invoked. > >> > > >> > Jack > >> > > >> > On 29 October 2014 15:36, Andrew Block wrote: > >> > > >> > > Jack, > >> > > > >> > > Have you added the handler to the Camel Registry with the name > >> > > MyContextHandler? In your example, you are referencing the > >> > > =E2=80=9CMyContetHandler=E2=80=9D in your route, but never show it= being added to > the > >> Camel > >> > > registry. > >> > > > >> > > - Andy > >> > > > >> > > -- > >> > > Andrew Block > >> > > > >> > > > >> > > On October 29, 2014 at 10:14:21 AM, jack atwork ( > jrmpatwork@gmail.com > >> ) > >> > > wrote: > >> > > > >> > > apologies, hit send by a bit early! > >> > > > >> > > Hi, > >> > > > >> > > I'm trying to configure a servlet using the camel-jetty component > but > >> I'm > >> > > struggling and hoping somebody might be able to point out what I'm > >> doing > >> > > wrong. > >> > > > >> > > I expected to be able to register a new Handler and reference it i= n > >> the > >> > > endpoint uri. > >> > > > >> > > ServletContextHandler handler =3D new ServletContextHandler(); > >> > > handler.addServlet(new ServletHolder(myServlet), "/*"); > >> > > > >> > > Then adding a route to my routeBuilder: > >> > > > >> > > from("jetty: > >> > > > >> http://localhost:8080/?matchOnUriPrefix=3Dtrue&handlers=3D#MyContextHa= ndler > ") > >> > > .to("log:foo"); > >> > > > >> > > I can see my servlet gets initialised but it is never invoked on a= ny > >> > > requests. Can anyone tell me what's missing? > >> > > > >> > > Thanks, > >> > > > >> > > Jack > >> > > > >> > > > >> > > On 29 October 2014 15:06, jack atwork wrote: > >> > > > >> > > > Hi, > >> > > > > >> > > > I'm trying to configure a servlet using the camel-jetty componen= t > >> but > >> > > I'm > >> > > > struggling and hoping somebody might be able to point out what I= 'm > >> doing > >> > > > wrong. > >> > > > > >> > > > I expected to be able to register a new Handler and reference it > in > >> the > >> > > > endpoint uri . > >> > > > > >> > > > ServletContextHandler handler =3D new ServletContextHandler(); > >> > > > handler.addServlet(new ServletHolder(myServlet), "/*"); > >> > > > > >> > > > Then adding a route to my routeBuilder: > >> > > > > >> > > > > >> > > > > >> > > > > >> > > > > >> > > > >> > > > >> > > >> > >> > > > --e89a8ff1ce223dffa905070a57e0--