Skip to content

Fix index out of bounds exception#1234

Merged
trask merged 1 commit into
microsoft:masterfrom
dmetzgar:fix-tracecontextcorrelation
May 18, 2020
Merged

Fix index out of bounds exception#1234
trask merged 1 commit into
microsoft:masterfrom
dmetzgar:fix-tracecontextcorrelation

Conversation

@dmetzgar

Copy link
Copy Markdown

Blocked by an exception when running an application:

java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
	at com.microsoft.applicationinsights.web.internal.correlation.TraceContextCorrelation.generateChildDependencyTarget(TraceContextCorrelation.java:381)
	at com.microsoft.applicationinsights.web.internal.SdkBridgeImpl.generateChildDependencyTarget(SdkBridgeImpl.java:57)
	at com.microsoft.applicationinsights.agent.internal.model.OutgoingSpanImpl.toHttpTelemetry(OutgoingSpanImpl.java:163)
	at com.microsoft.applicationinsights.agent.internal.model.OutgoingSpanImpl.endInternal(OutgoingSpanImpl.java:111)
	at com.microsoft.applicationinsights.agent.internal.model.OutgoingSpanImpl.end(OutgoingSpanImpl.java:72)
	at org.glowroot.instrumentation.apachehttpclient.ApacheHttpClient4xInstrumentation.onReturnCommon(ApacheHttpClient4xInstrumentation.java:138)
	at org.glowroot.instrumentation.apachehttpclient.ApacheHttpClient4xInstrumentation.access$400(ApacheHttpClient4xInstrumentation.java:41)
	at org.glowroot.instrumentation.apachehttpclient.ApacheHttpClient4xInstrumentation$ExecuteAdvice.onReturn(ApacheHttpClient4xInstrumentation.java:73)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
	at org.springframework.http.client.HttpComponentsClientHttpRequest.executeInternal(HttpComponentsClientHttpRequest.java:87)
	at org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48)
	at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53)
	at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:739)
	at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:674)
	at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:583)

I built a local version of the jars from this repo and tried them with this fix and it works.

@littleaj littleaj requested review from a team and trask and removed request for a team May 13, 2020 21:20

@trask trask left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

@trask trask merged commit 67ff6be into microsoft:master May 18, 2020
trask pushed a commit that referenced this pull request Oct 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants