camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Configuring Two Contexts in Camel Blueprint - how to set ServletComponent 'servletName' property
Date Mon, 13 Nov 2017 07:35:26 GMT

Configure it as a <bean id="servlet" class="...ServletComponent">
where you can set the servlet name as a property

On Sun, Nov 12, 2017 at 8:58 PM, JT <> wrote:
> Hi,
> I am trying to create two independent Camel Contexts with Camel blueprint
> (as two separate bundles) that will be deployed into the same OSGi
> container, exactly the same as described here:
> I also have encountered the same issue as described in that question, namely
> that the two CamelHttpTransportServlet instances are created with the same
> default name of 'CamelServlet'. The obvious solution is to set the
> servletName as a property to OsgiServletRegisterer however this then results
> in a HTTP 404 error when one of the URLs is called.
> I've traced it down to the ServletComponent class. It has a 'servletName'
> property that is set to 'CamelServlet' by default thus is registered in
> HttpRegistry under a different name to that specified to the
> OsgiServletRegisterer. I've verified this by debugging around the creation
> of Servletcomponent and manually setting the same setting name - I no longer
> get the 404 error.
> The solution seems to therefore be to configure the servletName on the
> ServletComponent but I cannot find anyway to do this. I've referred to:
> where it describes a 'servletName' option but cannot specify this in my
> blueprint XML file, eg the '<restConfiguation>' tag doesn't take such an
> attribute nor can I specify it as a property.
> Is there a way, using the blueprint XML I can specify the 'servletName'?
> Thanks, Kerry

Claus Ibsen
----------------- @davsclaus
Camel in Action 2:

View raw message