You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Manjanshavali <ma...@gmail.com> on 2016/10/19 06:07:23 UTC

https4 protocal is giving org.apache.http.client.ClientProtocolException caused by: null

I am setting 

process:
----------
1)setting property in process method.

exchange.setProperty("redeem_uri",value);

rote:
-----
2) using the same property in the below route
<route>
<setHeader headerName="CamelHttpMethod">
	<constant>PATCH</constant>
</setHeader>
<setHeader headerName="CamelHttpUri">
	<simple>${property[redeem_uri]}</simple>
</setHeader>
----------------
------------------
------------------
</route>

result:
------
Exception: the exception org.apache.http.client.ClientProtocolException
caused by: null

I am added the jar files:
---------------------------
<dependency>
	<groupId>org.apache.camel</groupId>
        <artifactId>camel-http4</artifactId>
	<version>2.14.2</version>
</dependency>
<dependency>
	<groupId>org.apache.httpcomponents</groupId>
	<artifactId>httpclient</artifactId>
	<version>4.5.2</version>
</dependency>

Question:
-----------
why i am getting the exception? what mistake i have done?

kindly provide me the soluion.



--
View this message in context: http://camel.465427.n5.nabble.com/https4-protocal-is-giving-org-apache-http-client-ClientProtocolException-caused-by-null-tp5788945.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: https4 protocal is giving org.apache.http.client.ClientProtocolException caused by: null

Posted by Manjanshavali <ma...@gmail.com>.
Hi,

I am trying to use CamelHttpUri instead of <inOut uri="" />

setting CamelHttpUri header with the below url:
https4://xxx.xxx.xx/-----------------
<route>
<setHeader headerName="CamelHttpUri">
	<simple>${property[redeem_uri]}</simple>
</setHeader>
<setHeader headerName="Content-Type">
	<constant>application/json</constant>
</setHeader>
<setHeader headerName="Accept">
	<constant>application/vnd.api+json</constant>
</setHeader>
<doTry>
<inOut
	uri="some dummy url" />
<doCatch>
     <exception>java.lang.Exception</exception>
     <to uri="bean:some bean" />
</doCatch>
</doTry>
</route>

Note: when i am removing the below header and depend upon the <inOut
uri="https4://-------" /> it is working means i am able to hit the target.
if i use CamelHttpUri header it is giving the exception
org.apache.http.client.ClientProtocolException caused by: null, I suspect
that problem with CamelHttpUri when i am using https4, the same is working
fine with https protocol.

<setHeader headerName="CamelHttpUri">
	<simple>${property[redeem_uri]}</simple>
</setHeader>

In case if i use <inOut uri="https4://-------" /> I have one problem, that
is i cannot be able to pass exchange property value in uri see example
below.
process:
--------
exchange.setProperty("someValue",someValue);

route:
-------
<inOut uri="https4://xxx.xxx.xx/---------------/${property.someValue}" />

the above ${property.someValue} is going as it is not the value. if you know
the solution either one is fine, thanks for help.





--
View this message in context: http://camel.465427.n5.nabble.com/https4-protocal-is-giving-org-apache-http-client-ClientProtocolException-caused-by-null-tp5788945p5788989.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: https4 protocal is giving org.apache.http.client.ClientProtocolException caused by: null

Posted by Tomohisa Igarashi <tm...@gmail.com>.
Can you provide more info so we can replay? A link to the minimal reproducer project would be the best, you would place it on your github or like that. Whole route and full stacktrace would be still helpful.

On 10/19/2016 03:07 PM, Manjanshavali wrote:
> I am setting
>
> process:
> ----------
> 1)setting property in process method.
>
> exchange.setProperty("redeem_uri",value);
>
> rote:
> -----
> 2) using the same property in the below route
> <route>
> <setHeader headerName="CamelHttpMethod">
> 	<constant>PATCH</constant>
> </setHeader>
> <setHeader headerName="CamelHttpUri">
> 	<simple>${property[redeem_uri]}</simple>
> </setHeader>
> ----------------
> ------------------
> ------------------
> </route>
>
> result:
> ------
> Exception: the exception org.apache.http.client.ClientProtocolException
> caused by: null
>
> I am added the jar files:
> ---------------------------
> <dependency>
> 	<groupId>org.apache.camel</groupId>
>         <artifactId>camel-http4</artifactId>
> 	<version>2.14.2</version>
> </dependency>
> <dependency>
> 	<groupId>org.apache.httpcomponents</groupId>
> 	<artifactId>httpclient</artifactId>
> 	<version>4.5.2</version>
> </dependency>
>
> Question:
> -----------
> why i am getting the exception? what mistake i have done?
>
> kindly provide me the soluion.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/https4-protocal-is-giving-org-apache-http-client-ClientProtocolException-caused-by-null-tp5788945.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>