Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Agent bytecode instrumentation wrong for Apache HttpClient #276

Closed
jhsheets opened this issue Feb 4, 2016 · 3 comments
Closed

Agent bytecode instrumentation wrong for Apache HttpClient #276

jhsheets opened this issue Feb 4, 2016 · 3 comments
Labels
Milestone

Comments

@jhsheets
Copy link

jhsheets commented Feb 4, 2016

The HttpClassDataProvider.java file has the following constant defined:

private final static String HTTP_CLIENT_METHOD_42_SIGNATURE = "(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/HttpResponse;";

This isn't the actual method signature, and it's causing errors. The actual signature should be:
private final static String HTTP_CLIENT_METHOD_42_SIGNATURE = "(Lorg/apache/http/HttpHost;Lorg.apache.http.client.methods.HttpUriRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/HttpResponse;";

Without this fix, libraries that use HttpClient are blowing up. Here's an example using agent on a webapp using Amazon's S3 java library (which depends on HttpClient):

Caused by: java.lang.VerifyError: (class: org/apache/http/impl/client/AbstractHttpClient, method: execute signature: (Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/HttpResponse;) Incompatible object argument for function call
at com.amazonaws.http.HttpClientFactory.createHttpClient(HttpClientFactory.java:106)
at com.amazonaws.http.AmazonHttpClient.<init>(AmazonHttpClient.java:193)
at com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:119)
at com.amazonaws.AmazonWebServiceClient.<init>(AmazonWebServiceClient.java:103)
at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:365)
at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:347)
@gupele
Copy link
Contributor

gupele commented Feb 17, 2016

Hi,

Thank you for your input!

We will need to look into this, meanwhile you can disable the built-in 'HTTP' instrumentation using the AI-Agent.xml configuration file.
If that is still something you need to monitor, you can add it 'manually' in that file with the correct signature

@jhsheets
Copy link
Author

I tried disabling the instrumentation once, but it continued to throw the
exception. It's possible I didn't disable it properly, but I thought I did
it right.

On Wed, Feb 17, 2016 at 4:23 AM, gupele notifications@github.com wrote:

Hi,

Thank you for your input!

We will need to look into this, meanwhile you can disable the built-in
'HTTP' instrumentation using the AI-Agent.xml configuration file.
If that is still something you need to monitor, you can add it 'manually'
in that file with the correct signature


Reply to this email directly or view it on GitHub
#276 (comment)
.

@Dmitry-Matveev Dmitry-Matveev added this to the 1.0.8 milestone Feb 2, 2017
@beckylino beckylino modified the milestones: 1.0.9, 1.0.8 Jun 5, 2017
@beckylino beckylino modified the milestones: 1.0.9, 1.0.10 Jun 15, 2017
@beckylino beckylino modified the milestones: future, 1.0.10 Aug 2, 2017
@dhaval24 dhaval24 modified the milestones: 1.0.10, 1.0.11 Oct 2, 2017
@dhaval24
Copy link
Contributor

dhaval24 commented Dec 5, 2017

Fixed in #449

@dhaval24 dhaval24 closed this as completed Dec 5, 2017
@dhaval24 dhaval24 modified the milestones: 1.0.11, 2.0.0 Dec 27, 2017
@ghost ghost locked as resolved and limited conversation to collaborators Jul 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants