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 [6961...@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