Rupesh029 / typica

Automatically exported from code.google.com/p/typica
Apache License 2.0
0 stars 0 forks source link

ClassCastException using Apache HttpClient 4.2 #135

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
> What steps will reproduce the problem?
1. Include typica 1.7.2 jar file in an environment with Apache HttpClient 4.2+
2. I can reproduce this problem on Jec2.describeSecurityGroups, though I 
believe most any query method will be affected.

> What is the expected output? What do you see instead?

The request fails with the output:
java.lang.ClassCastException: java.lang.String cannot be cast to 
org.apache.http.HttpHost
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:416)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784)
    at com.xerox.amazonws.common.AWSQueryConnection.makeRequest(AWSQueryConnection.java:475)
    at com.xerox.amazonws.ec2.Jec2.makeRequestInt(Jec2.java:2785)
    at com.xerox.amazonws.ec2.Jec2.describeSecurityGroups(Jec2.java:1122)
    at com.xerox.amazonws.ec2.Jec2.describeSecurityGroups(Jec2.java:1101)
    at com.xerox.amazonws.ec2.Jec2.describeSecurityGroups(Jec2.java:1089)

Note, these calls all appear to be functional once we downgrade back to Apache 
HttpClient 4.1.

> What version of the product are you using? On what operating system?

Typica 1.7.2
Windows Vista
Apache HttpClient 4.2.3
Apache HttpCore 4.2.3
Apache Commons Codec 1.7.0

> Please provide any additional information below.

This looks to be the same result as was previously reported in Issue #107. 
However, it looks as if that issue may have been mitigated in HttpClient 4.1, 
but resurfaced in HttpClient 4.2.

I've managed to correct the issue in our environment with a 1 line fix to 
AWSQueryConnection. The patch file is supplied. I'm not sure if there are other 
areas of the code that need updates, but this patch seems to correct most of 
the behavior for us.

Thanks!

Original issue reported on code.google.com by fzig...@webperformance.com on 18 Mar 2013 at 8:00

Attachments: