camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ganesh Bonde" <gbo...@dhlglobalmail.com>
Subject Problem connecting the http link using Camel
Date Fri, 02 Aug 2013 15:12:05 GMT
Hi Everyone,

                        I am working on a task where I am using Camel
framework for sending HTTP post request. I have used the code given
below to send http post request. We have two servers. We are able to
send this request using one server. The second server is behind a proxy
server. We are not able to send post request using this second server
since it is behind proxy server. Is there a way where we can configure
the proxy details in Camel so that it will successfully send the http
request ? Right now we are getting error stack trace as given below. We
do not want to send the proxy details through the URL in the code given
below. 

 

 

Code:

                  from("file:{{xyz.home}}/dsp/abc/docs?delay={{"

                    +
"abc.file.poll}}&pollStrategy=#emailOnError&antInclude=**/*.xml&recursiv
e=true&readLock=changed&move=.sent")

                .autoStartup("{{abc.sendreport.autoStartup}}")

                .log(" sendreport processing ...")

                .setHeader(Exchange.HTTP_METHOD,
constant("POST")).to("https4:{{abc.URL}}?throwExceptionOnFailure=true")

                .setHeader(Exchange.FILE_NAME,
constant("${file:onlyname.noext}"))

                .to("file:{{xyz.home}}/abc/response");

 

 

Error Stack trace:

 

 

 

org.apache.http.conn.HttpHostConnectException: Connection to
https://www.abc.com refused

                at
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection
(DefaultClientConnectionOperator.java:158)

                at
org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:
150)

                at
org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledC
onnAdapter.java:121)

                at
org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultReq
uestDirector.java:575)

                at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultReques
tDirector.java:425)

                at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClien
t.java:820)

                at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClien
t.java:754)

                at
org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClien
t.java:732)

                at
org.apache.camel.component.http4.HttpProducer.executeMethod(HttpProducer
.java:243)

                at
org.apache.camel.component.http4.HttpProducer.process(HttpProducer.java:
149)

                at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProc
essorBridge.process(AsyncProcessorConverterHelper.java:61)

                at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.
java:73)

                at
org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcess
or.java:120)

                at
org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java
:292)

                at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:115)

                at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.
java:73)

                at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAs
yncProcessor.java:99)

                at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncP
rocessor.java:90)

                at
org.apache.camel.management.InstrumentationProcessor.process(Instrumenta
tionProcessor.java:73)

                at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.
java:73)

                at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAs
yncProcessor.java:99)

                at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncP
rocessor.java:90)

                at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInt
erceptor.java:163)

                at
org.apache.camel.processor.interceptor.HandleFaultInterceptor.process(Ha
ndleFaultInterceptor.java:41)

                at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.
java:73)

                at
org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(Re
deliveryErrorHandler.java:330)

                at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErro
rHandler.java:220)

                at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContex
tProcessor.java:45)

                at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncP
rocessor.java:90)

                at
org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultCha
nnel.java:303)

                at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.
java:73)

                at
org.apache.camel.processor.Pipeline.process(Pipeline.java:117)

                at
org.apache.camel.processor.Pipeline.process(Pipeline.java:80)

                at
org.apache.camel.processor.RouteContextProcessor.processNext(RouteContex
tProcessor.java:45)

                at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncP
rocessor.java:90)

                at
org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkPr
ocessor.java:150)

                at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcess
or.java:117)

                at
org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(
RouteInflightRepositoryProcessor.java:48)

                at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncP
rocessor.java:90)

                at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.
java:73)

                at
org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAs
yncProcessor.java:99)

                at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncP
rocessor.java:90)

                at
org.apache.camel.management.InstrumentationProcessor.process(Instrumenta
tionProcessor.java:73)

                at
org.apache.camel.component.file.GenericFileConsumer.processExchange(Gene
ricFileConsumer.java:336)

                at
org.apache.camel.component.file.GenericFileConsumer.processBatch(Generic
FileConsumer.java:189)

                at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileCons
umer.java:155)

                at
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.
java:139)

                at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.ja
va:91)

                at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

                at
java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:35
1)

                at
java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)

                at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.acc
ess$301(ScheduledThreadPoolExecutor.java:178)

                at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run
(ScheduledThreadPoolExecutor.java:293)

                at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.jav
a:1110)

                at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja
va:603)

                at java.lang.Thread.run(Thread.java:722)

Caused by: java.net.ConnectException: Connection refused

                at java.net.PlainSocketImpl.socketConnect(Native Method)

                at
java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:
337)

                at
java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImp
l.java:198)

                at
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:18
0)

                at
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)

                at java.net.Socket.connect(Socket.java:579)

                at
sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:607)

                at
org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory
.java:375)

                at
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection
(DefaultClientConnectionOperator.java:148)

                ... 55 more

 

 

Regards

Ganesh 

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message