Hi, Can you show us more about the cause of the exception? As the NoSuchBeanException should have the cause of the exception.
-- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Saturday, July 20, 2013 at 10:12 PM, lmanchanda75 wrote: > Hi, > > I want to set preemtive auth On of the servers, I am using http4 component, > going through various posts/camel documentation > (http://camel.apache.org/http4.html), I arrived at conclusion that I need to > set httpContext on the component/endpoint. I wrote a small piece of code to > create HttpContext and called the same in blueprint to set my bean in > registry as shown below: > > public class HttpContextFactory { > > Code- > > public static HttpContext getObject(String httpHost,Integer httpPort) { > > HttpContext httpContext = new BasicHttpContext() ; > BasicAuthCache authCache = new BasicAuthCache(); > BasicScheme basicAuth = new BasicScheme(); > authCache.put(new HttpHost(httpHost, httpPort), basicAuth); > > httpContext.setAttribute(ClientContext.AUTH_CACHE, authCache); > > return httpContext; > } > > > > } > > > > Blueprint - > > <bean id="messageBrokerAuthContext" > class="manchanda.lalit.TryCxfSmooks.HttpContextFactory" > factory-method="getObject"> > <argument value="172.168.1.100"/> > <argument value="1443"/> > </bean> > > > > Usage - > > http4://172.168.1.100?authUsername=user&authPassword=password&httpContext=messageBrokerAuthContext > > > During execution I get the following error- > > > Caused by: org.apache.camel.NoSuchBeanException: Found bean: > messageBrokerAuthCo > ntext in BlueprintContainer: > org.apache.aries.blueprint.container.BlueprintConta > inerImpl@c8f24 of type: org.apache.http.protocol.BasicHttpContext expected > type was: interface org.apache.http.protocol.HttpContext > > > > This does not seem to be correct as it will never be possible to get > instance of HttpContext type it being an Interface. > > How can I solve my problem of setting preemptive auth? > > Regds > Lalit > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Camel-HTTP4-not-able-to-use-httpContext-endpoint-option-tp5735937.html > Sent from the Camel - Users mailing list archive at Nabble.com > (http://Nabble.com).