camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Jetty HTTP Authentication
Date Tue, 18 Aug 2009 12:28:47 GMT
On Tue, Aug 18, 2009 at 2:27 PM, M.Ismail<mohammed.hany@gmail.com> wrote:
>
> Hi,
> I figure this problem out. The problem was that the http-component version
> is older than the camel-core version. Now, all version are in sync v1.6.1
> and everything is working fine.
>

Fantastic. Glad it works with HTTPS on both jetty and the http so you
can do it both ways.


> Thanks willem.jiang
>
>
>
>
> M.Ismail wrote:
>>
>> Hi,
>> I've tried using the HTTP component and not the jetty one for the
>> destination and adding the HTTP basic authentication options to the URL
>> but I get the same exception. Here is the code after the modifications:
>> from("jetty:http://127.0.0.1:9000/Integration").process(new
>> MyProcessor()).process(new
>> ValidationProcessor()).to("https://172.18.40.60/SoapInterface?username=itsuser&password=itsuser1");
>>
>> I have even tried the following option:
>> httpClient.authenticationPreemptive=true
>> from("jetty:http://127.0.0.1:9000/Integration").process(new
>> MyProcessor()).process(new
>> ValidationProcessor()).to("https://172.18.40.60/SoapInterface?httpClient.authenticationPreemptive=true&username=itsuser&password=itsuser1");
>>
>> Still, I have no idea why I get this exception:
>>
>> 9844  ERROR [26285376@qtp1-0] processor.DeadLetterChannel - Failed
>> delivery for exchangeId: ID-moismail-nb/1119-1250594930875/0-0. On
>> delivery attempt: 4 caught:
>> org.apache.camel.component.http.HttpOperationFailedException: HTTP
>> operation failed with statusCode: 401, status: HTTP/1.1 401 Unauthorized
>> org.apache.camel.component.http.HttpOperationFailedException: HTTP
>> operation failed with statusCode: 401, status: HTTP/1.1 401 Unauthorized
>>        at
>> org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:114)
>>        at
>> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:43)
>>        at
>> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:84)
>>        at
>> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
>>        at
>> org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87)
>>        at
>> org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82)
>>        at
>> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:189)
>>        at
>> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:133)
>>        at org.apache.camel.processor.Pipeline.process(Pipeline.java:115)
>>        at org.apache.camel.processor.Pipeline.process(Pipeline.java:89)
>>        at
>> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
>>        at
>> org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87)
>>        at
>> org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82)
>>        at
>> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
>>        at
>> org.apache.camel.component.jetty.CamelContinuationServlet.service(CamelContinuationServlet.java:54)
>>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>>        at
>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
>>        at
>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
>>        at
>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
>>        at
>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>>        at
>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>>        at org.mortbay.jetty.Server.handle(Server.java:324)
>>        at
>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
>>        at
>> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879)
>>        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:741)
>>        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:213)
>>        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
>>        at
>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>>        at
>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
>> 10922 ERROR [26285376@qtp1-0] processor.DeadLetterChannel - Failed
>> delivery for exchangeId: ID-moismail-nb/1119-1250594930875/0-0. On
>> delivery attempt: 5 caught:
>> org.apache.camel.component.http.HttpOperationFailedException: HTTP
>> operation failed with statusCode: 401, status: HTTP/1.1 401 Unauthorized
>> org.apache.camel.component.http.HttpOperationFailedException: HTTP
>> operation failed with statusCode: 401, status: HTTP/1.1 401 Unauthorized
>>        at
>> org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:114)
>>        at
>> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:43)
>>        at
>> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:84)
>>        at
>> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
>>        at
>> org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87)
>>        at
>> org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82)
>>        at
>> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:189)
>>        at
>> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:133)
>>        at org.apache.camel.processor.Pipeline.process(Pipeline.java:115)
>>        at org.apache.camel.processor.Pipeline.process(Pipeline.java:89)
>>        at
>> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
>>        at
>> org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87)
>>        at
>> org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82)
>>        at
>> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
>>        at
>> org.apache.camel.component.jetty.CamelContinuationServlet.service(CamelContinuationServlet.java:54)
>>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>>        at
>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
>>        at
>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
>>        at
>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
>>        at
>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>>        at
>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>>        at org.mortbay.jetty.Server.handle(Server.java:324)
>>        at
>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
>>        at
>> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879)
>>        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:741)
>>        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:213)
>>        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
>>        at
>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>>        at
>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
>> 10922 DEBUG [26285376@qtp1-0] impl.DefaultCamelContext -
>> log:org.apache.camel.DeadLetterChannel?level=error converted to endpoint:
>> Endpoint[log:org.apache.camel.DeadLetterChannel?level=error] by component:
>> org.apache.camel.component.log.LogComponent@15e00b7
>> 10938 ERROR [26285376@qtp1-0] camel.DeadLetterChannel -
>> Exchange[BodyType:String, Body:<SOAP-ENV:Envelope
>> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><soap:messagebody/>
>> </SOAP-ENV:Body></SOAP-ENV:Envelope>]
>> 10938 ERROR [26285376@qtp1-0] processor.DeadLetterChannel - Failed
>> delivery for exchangeId: ID-moismail-nb/1119-1250594930875/0-0. Handled by
>> the failure processor:
>> RecipientList[log:org.apache.camel.DeadLetterChannel?level=error]
>>
>> Thanks,
>>
>>
>> willem.jiang wrote:
>>>
>>> Hi,
>>>
>>> I think you misused the security handler.
>>>
>>> from("jetty:http://127.0.0.1:9000/Integration").process(new
>>> MyProcessor()).process(new
>>> ValidationProcessor()).to("jetty:https://172.18.40.60/SoapInterface?handlers=securityHandler);
>>>
>>> Current Jetty component extends the http component which is using the
>>> common http client to invoke the http service or https service, and the
>>> jetty securityHandler does not work for it.
>>>
>>> You can find the usage of the http component[1] here.
>>> [1] http://camel.apache.org/http.html
>>>
>>> Willem
>>>
>>> M.Ismail wrote:
>>>> Hi
>>>>
>>>> I am using a web service that uses both SSL encryption and http
>>>> authentication. I've already passed the SSL encryption. I'm trying to
>>>> set
>>>> the user name and password for the following destination
>>>> from("jetty:http://127.0.0.1:9000/Integration").process(new
>>>> MyProcessor()).process(new
>>>> ValidationProcessor()).to("jetty:https://172.18.40.60/SoapInterface?handlers=securityHandler);
>>>>
>>>> and I am using the following bean in camel-context.xml
>>>> <!-- Jetty Security handling -->
>>>>      <bean id="userRealm"
>>>> class="org.mortbay.jetty.plus.jaas.JAASUserRealm">
>>>>              <property name="name" value="tracker-users" />
>>>>              <property name="username" value="itsuser" />
>>>>              <property name="password" value="itsuser1" />
>>>>              <property name="roleClassNames"
>>>> value="com.classactionpl.jaas.UserGroup"
>>>> />
>>>>      </bean>
>>>>      <bean id="constraint"
>>>> class="org.mortbay.jetty.security.Constraint">
>>>>              <property name="name" value="BASIC" />
>>>>              <property name="roles" value="tracker-users" />
>>>>              <property name="authenticate" value="true" />
>>>>      </bean>
>>>>      <bean id="constraintMapping"
>>>> class="org.mortbay.jetty.security.ConstraintMapping">
>>>>              <property name="constraint" ref="constraint" />
>>>>              <property name="pathSpec" value="/*" />
>>>>      </bean>
>>>>       <bean id="securityHandler"
>>>> class="org.mortbay.jetty.security.SecurityHandler">
>>>>              <property name="userRealm" ref="userRealm" />
>>>>               <property name="constraintMappings"
>>>> ref="constraintMapping" />
>>>>      </bean>
>>>>
>>>> The following is the exception that I am getting:
>>>> 6578  ERROR [6961504@qtp1-0] processor.DeadLetterChannel - Failed
>>>> delivery
>>>> for exchangeId: ID-moismail-nb/4500-1250530211250/0-0. On delivery
>>>> attempt:
>>>> 0 caught: org.apache.camel.component.http.HttpOperationFailedException:
>>>> HTTP
>>>> operation failed with statusCode: 401, status: HTTP/1.1 401 Unauthorized
>>>> org.apache.camel.component.http.HttpOperationFailedException: HTTP
>>>> operation
>>>> failed with statusCode: 401, status: HTTP/1.1 401 Unauthorized
>>>>      at
>>>> org.apache.camel.component.http.HttpProducer.process(HttpProducer.java:114)
>>>>      at
>>>> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:43)
>>>>      at
>>>> org.apache.camel.processor.SendProcessor.process(SendProcessor.java:84)
>>>>      at
>>>> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
>>>>      at
>>>> org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87)
>>>>      at
>>>> org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82)
>>>>      at
>>>> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:189)
>>>>      at
>>>> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:133)
>>>>      at org.apache.camel.processor.Pipeline.process(Pipeline.java:115)
>>>>      at org.apache.camel.processor.Pipeline.process(Pipeline.java:89)
>>>>      at
>>>> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
>>>>      at
>>>> org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87)
>>>>      at
>>>> org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82)
>>>>      at
>>>> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
>>>>      at
>>>> org.apache.camel.component.jetty.CamelContinuationServlet.service(CamelContinuationServlet.java:54)
>>>>      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>>>>      at
>>>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:502)
>>>>      at
>>>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:363)
>>>>      at
>>>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
>>>>      at
>>>> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>>>>      at
>>>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>>>>      at org.mortbay.jetty.Server.handle(Server.java:324)
>>>>      at
>>>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:534)
>>>>      at
>>>> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:879)
>>>>      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:741)
>>>>      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:213)
>>>>      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:403)
>>>>      at
>>>> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>>>>      at
>>>> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:522)
>>>>
>>>> Can you please tell what is going wrong?
>>>> btw: I am using camel 1.6.1 and jetty 1.5.1.0
>>>>
>>>> Thanks
>>>
>>>
>>>
>> Quoted from:
>> http://www.nabble.com/Jetty-HTTP-Authentication-tp25011226p25017186.html
>>
>
> --
> View this message in context: http://www.nabble.com/Jetty-HTTP-Authentication-tp25011226p25023803.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message